Changeset 1260


Ignore:
Timestamp:
05/11/10 12:31:04 (9 years ago)
Author:
gogo
Message:

#1471 and #1508 Better fix for IE8 TableOperations? (and others) and editing inside absolute positioned elements.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r1256 r1260  
    15471547  // ._toolbar is for legacy, ._toolBar is better thanks. 
    15481548  this._toolBar = this._toolbar = toolbar; 
    1549   toolbar.className = "toolbar"; 
    1550   toolbar.unselectable = "1"; 
     1549  toolbar.className = "toolbar";   
    15511550  toolbar.align = this.config.toolbarAlign; 
    15521551   
     
    15591558 
    15601559        this._createToolbar1(editor, toolbar, tb_objects); 
     1560         
     1561        // IE8 is totally retarded, if you click on a toolbar element (eg button) 
     1562        // and it doesn't have unselectable="on", then it defocuses the editor losing the selection 
     1563        // so nothing works.  Particularly prevalent with TableOperations 
     1564        function noselect(e) 
     1565        { 
     1566    if(e.tagName) e.unselectable = "on";         
     1567    if(e.childNodes) 
     1568    { 
     1569      for(var i = 0; i < e.childNodes.length; i++) if(e.tagName) noselect(e.childNodes(i)); 
     1570    } 
     1571        } 
     1572        noselect(toolbar); 
     1573         
     1574         
    15611575        this._htmlArea.appendChild(toolbar);       
    15621576   
     
    36153629          editor.sizeEditor();  
    36163630        } 
    3617       }); 
     3631      });       
    36183632      editor.removeLoadingMessage(); 
    36193633    } 
  • trunk/modules/InlineStyler/InlineStyler.js

    r1165 r1260  
    112112      break; 
    113113    case "borderWidth": 
    114       style[i] = val + "px"; 
     114      style[i] = val ? val + "px" : '0px'; 
    115115      break; 
    116116    default:       
  • trunk/modules/InternetExplorer/InternetExplorer.js

    r1259 r1260  
    363363      // certainly the buggiest browser in the world and I 
    364364      // wonder, God, how can Earth stand it? 
    365       return range.parentElement(); 
     365      try 
     366      { 
     367        return range.parentElement(); 
     368      } 
     369      catch(e) 
     370      { 
     371        return this._doc.body; // ?? 
     372      } 
     373       
    366374    case "Control": 
    367375      return range.item(0); 
     
    448456 * @returns Range 
    449457 */ 
    450 Xinha.prototype.saveSelection = function() 
    451 { 
    452   return this.createRange(this.getSelection()) 
     458Xinha.prototype.saveSelection = function(sel) 
     459{ 
     460  return this.createRange(sel ? sel : this.getSelection()) 
    453461} 
    454462/**  
  • trunk/plugins/TableOperations/TableOperations.js

    r1075 r1260  
    535535        table.summary = val; 
    536536        break; 
    537       case "width": 
    538         table.style.width = ("" + val) + params.f_unit; 
    539         break; 
    540537      case "align": 
    541538        table.align = val; 
Note: See TracChangeset for help on using the changeset viewer.