diff options
author | John McLear <john@mclear.co.uk> | 2014-03-05 21:44:32 +0000 |
---|---|---|
committer | John McLear <john@mclear.co.uk> | 2014-03-05 21:44:32 +0000 |
commit | f5716a3b2600a34623901952d825dfeaa1621691 (patch) | |
tree | a44ebfda022eb938db27302a897b28655767a101 /src/static | |
parent | df205a4ef47554aae97f24c1f08084f50ad5156e (diff) | |
download | etherpad-lite-f5716a3b2600a34623901952d825dfeaa1621691.zip |
cleaner logic
Diffstat (limited to 'src/static')
-rw-r--r-- | src/static/js/domline.js | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/static/js/domline.js b/src/static/js/domline.js index 8756a285..b1927b16 100644 --- a/src/static/js/domline.js +++ b/src/static/js/domline.js @@ -119,13 +119,8 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) { if(listType.indexOf("number") < 0) { - if(!preHtml){ - preHtml = '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; - postHtml = '</li></ul>'; - }else{ - preHtml += '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; - postHtml = '</li></ul>' + postHtml; - } + preHtml += '<ul class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; + postHtml = '</li></ul>' + postHtml; } else { @@ -133,23 +128,11 @@ domline.createDomLine = function(nonEmpty, doesWrap, optBrowser, optDocument) if(start[1] == 1){ // if its the first one at this level? lineClass = lineClass + " " + "list-start-" + listType; // Add start class to DIV node } - if(!preHtml){ - preHtml = '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; - }else{ - preHtml += '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; - } - }else{ - if(!preHtml){ - preHtml = '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists - }else{ - preHtml += '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists - } - } - if(!postHtml){ - postHtml = '</li></ol>'; + preHtml += '<ol start='+start[1]+' class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; }else{ - postHtml = '</li></ol>'; + preHtml += '<ol class="list-' + Security.escapeHTMLAttribute(listType) + '"><li>'; // Handles pasted contents into existing lists } + postHtml += '</li></ol>'; } } processedMarker = true; |