Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Final change - allow all blockEls, and dont trim out whitespace from …
Browse files Browse the repository at this point in the history
…text nodes
  • Loading branch information
Ryan Mitchell authored and cheeaun committed Nov 15, 2009
1 parent fd39ec3 commit c5dabe5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -475,11 +475,11 @@ this.MooEditable = new Class({
var html = '';
var length = el.childNodes.length;
for (i=0;i<length;i++){
if (!['p','div'].contains(el.childNodes[i].nodeName.toLowerCase())){
if (!el.childNodes[i].nodeName.test(blockEls)){
if (el.childNodes[i].nodeName === '#text'){
if (el.childNodes[i].nodeValue.trim()){
if(start < 0) start = i;
html += el.childNodes[i].nodeValue.trim();
html += el.childNodes[i].nodeValue;
}
} else {
if(start < 0) start = i;
Expand All @@ -488,7 +488,7 @@ this.MooEditable = new Class({
} else {
create = true;
}
if(i==(length-1)) create = true;
if (i==(length-1)) create = true;
if (start >= 0 && create){
var newel = new Element(this.options.rootElement,{html:html});
el.replaceChild(newel,el.childNodes[start]);
Expand Down

0 comments on commit c5dabe5

Please sign in to comment.