Ticket #656: getSelectedHTML.patch

File getSelectedHTML.patch, 1.0 KB (added by mokhet, 14 years ago)
  • htmlarea.js

     
    32453245}; 
    32463246 
    32473247/// Retrieve the selected block 
    3248 HTMLArea.prototype.getSelectedHTML = function() { 
    3249   var sel = this._getSelection(); 
    3250   var range = this._createRange(sel); 
    3251   var existing = null; 
    3252   if (HTMLArea.is_ie) { 
    3253     existing = range.htmlText; 
    3254   } else { 
    3255     existing = HTMLArea.getHTML(range.cloneContents(), false, this); 
    3256   } 
    3257   return existing; 
    3258 }; 
     3248if (HTMLArea.is_ie) { 
     3249  HTMLArea.prototype.getSelectedHTML = function() { 
     3250    var sel = this._getSelection(); 
     3251    var range = this._createRange(sel); 
     3252    return range.htmlText; 
     3253  }; 
     3254} else { 
     3255  HTMLArea.prototype.getSelectedHTML = function() { 
     3256    var sel = this._getSelection(); 
     3257    var range = this._createRange(sel); 
     3258    return HTMLArea.getHTML(range.cloneContents(), false, this); 
     3259  }; 
     3260} 
    32593261 
    32603262/// Return true if we have some selection 
    32613263HTMLArea.prototype.hasSelectedText = function() {