Changeset 1135


Ignore:
Timestamp:
11/25/08 21:52:51 (10 years ago)
Author:
nicholasbs
Message:

Fixes #1193 (Removing style removes some of the text as well)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/Stylist/Stylist.js

    r1067 r1135  
    332332      // Must be a span with no classes and no id, so we can splice it out 
    333333      var prnt = el.parentNode; 
    334       var childs = el.childNodes; 
    335       for(var x = 0; x < childs.length; x++) 
    336       { 
    337         prnt.insertBefore(childs[x], el); 
     334      var tmp; 
     335      while (el.hasChildNodes()) 
     336      { 
     337        if (el.firstChild.nodeType == 1) 
     338        { 
     339          // if el.firstChild is an element, we've got to recurse to make sure classes are 
     340          // removed from it and and any of its children. 
     341          this._stylistRemoveClassesFull(el.firstChild, classes); 
     342        } 
     343        tmp = el.removeChild(el.firstChild); 
     344        prnt.insertBefore(tmp, el); 
    338345      } 
    339346      prnt.removeChild(el); 
Note: See TracChangeset for help on using the changeset viewer.