Changeset 929 for trunk/modules


Ignore:
Timestamp:
01/09/08 21:10:59 (12 years ago)
Author:
ray
Message:
  • #1115 Dialogs not working on firefox 3
  • #1127 InsertImage? and probably other things using insertNodeAtSelection() not working in FF3
Location:
trunk/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/modules/Dialogs/dialog.js

    r694 r929  
    2828                init = window;  // pass this window object by default 
    2929        } 
    30         Dialog._geckoOpenModal(url, action, init); 
     30        if (typeof window.showModalDialog == 'function') 
     31        { 
     32                Dialog._return = function(retVal) { 
     33                        if (typeof action == 'function') action (retVal); 
     34                } 
     35                var r = window.showModalDialog(url, init, "dialogheight=10;dialogwidth=10;resizable=yes"); 
     36        } 
     37        else 
     38        { 
     39                Dialog._geckoOpenModal(url, action, init); 
     40        } 
    3141} 
    3242 
  • trunk/modules/Gecko/Gecko.js

    r901 r929  
    396396Xinha.prototype.insertNodeAtSelection = function(toBeInserted) 
    397397{ 
     398  if ( toBeInserted.ownerDocument != this._doc ) // as of FF3, Gecko is strict regarding the ownerDocument of an element 
     399  { 
     400    try  
     401        { 
     402                toBeInserted = this._doc.adoptNode( toBeInserted ); 
     403        } catch (e) {} 
     404  } 
    398405  var sel = this.getSelection(); 
    399406  var range = this.createRange(sel); 
     
    404411  var pos = range.startOffset; 
    405412  var selnode = toBeInserted; 
     413   
    406414  switch ( node.nodeType ) 
    407415  { 
Note: See TracChangeset for help on using the changeset viewer.