Changeset 683 for trunk


Ignore:
Timestamp:
01/22/07 11:28:53 (13 years ago)
Author:
ray
Message:

Ticket #816 CharacterMap? and ListType? panel modes make editor jump to top in IE

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r682 r683  
    20612061  if ( panel && panel.style.display != 'none' ) 
    20622062  { 
     2063    try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 
    20632064    panel.style.display = 'none'; 
    20642065    this.notifyOf('panel_change', {'action':'hide','panel':panel}); 
    2065     //try { this.scrollToElement(); } catch(e) { } 
     2066    try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
    20662067  } 
    20672068}; 
     
    20712072  if ( panel && panel.style.display == 'none' ) 
    20722073  { 
    2073     panel.style.display = '';     
     2074    try { var pos = this.scrollPos(this._iframe.contentWindow); } catch(e) { } 
     2075        panel.style.display = '';     
    20742076    this.notifyOf('panel_change', {'action':'show','panel':panel}); 
    2075     //try { this.scrollToElement(); } catch(e) { } 
     2077    try { this._iframe.contentWindow.scrollTo(pos.x,pos.y)} catch(e) { } 
    20762078  } 
    20772079}; 
     
    55015503}; 
    55025504 
     5505Xinha.prototype.scrollPos = function(scope) 
     5506{ 
     5507  scope = (scope) ? scope : window; 
     5508  var x,y; 
     5509  if (scope.pageYOffset) // all except Explorer 
     5510  { 
     5511    x = scope.pageXOffset; 
     5512    y = scope.pageYOffset; 
     5513  } 
     5514  else if (document.documentElement && document.documentElement.scrollTop) 
     5515    // Explorer 6 Strict 
     5516  { 
     5517    x = scope.document.documentElement.scrollLeft; 
     5518    y = scope.document.documentElement.scrollTop; 
     5519  } 
     5520  else if (document.body) // all other Explorers 
     5521  { 
     5522    x = scope.document.body.scrollLeft; 
     5523    y = scope.document.body.scrollTop; 
     5524  } 
     5525  return {'x':x,'y':y}; 
     5526}; 
     5527 
    55035528/**  
    55045529 *  Calculate the top and left pixel position of an element in the DOM. 
Note: See TracChangeset for help on using the changeset viewer.