Changeset 1273


Ignore:
Timestamp:
11/17/10 17:17:41 (7 years ago)
Author:
ejucovy
Message:

closes #1559, <dl> button throws a JS error if the cursor context is the body element itself

File:
1 edited

Legend:

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

    r1067 r1273  
    5656  if (button_id=='dl') { //definition list 
    5757    var pe = editor.getParentElement(); 
    58     while (pe.parentNode.tagName.toLowerCase() != 'body') { 
    59       pe = pe.parentNode; 
     58    if( pe.tagName.toLowerCase() != 'body' ) { 
     59      while (pe.parentNode.tagName.toLowerCase() != 'body') { 
     60        pe = pe.parentNode; 
     61      } 
    6062    } 
    6163    var dx = editor._doc.createElement(button_id); 
    6264    dx.innerHTML = '&nbsp;'; 
    63     if(pe.parentNode.lastChild==pe) { 
     65    if( pe.tagName.toLowerCase() == 'body' ) { 
     66      pe.appendChild(dx); 
     67    }else if(pe.parentNode.lastChild==pe) { 
    6468      pe.parentNode.appendChild(dx); 
    6569    }else{ 
Note: See TracChangeset for help on using the changeset viewer.