Changeset 1219


Ignore:
Timestamp:
11/10/09 04:59:41 (9 years ago)
Author:
gogo
Message:

Ticket #1262

Alternative method for restoring from fullscreen mode.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XinhaCore.js

    r1209 r1219  
    900900   */ 
    901901  this.fullScreenMargins = [0,0,0,0]; 
     902   
     903   
     904  /** Specify the method that is being used to calculate the editor's size<br/> 
     905    * when we return from fullscreen mode. 
     906    *  There are two choices: 
     907    *  
     908    * <table border="1"> 
     909    *   <tr> 
     910    *       <td><em>initSize</em></td> 
     911    *       <td>Use the internal Xinha.initSize() method to calculate the editor's  
     912    *       dimensions. This is suitable for most usecases.</td> 
     913    *   </tr> 
     914    *   <tr> 
     915    *       <td><em>restore</em></td> 
     916    *       <td>The editor's dimensions will be stored before going into fullscreen 
     917    *       mode and restored when we return to normal mode, taking a possible 
     918    *       window resize during fullscreen in account.</td> 
     919    *     </tr> 
     920    * </table> 
     921    * 
     922    * Default: <code>"initSize"</code> 
     923    * @type String 
     924    */ 
     925  this.fullScreenSizeDownMethod = 'initSize'; 
    902926   
    903927  /** This array orders all buttons except plugin buttons in the toolbar. Plugin buttons typically look for one  
  • trunk/modules/FullScreen/full-screen.js

    r1113 r1219  
    22{ 
    33  this.editor = editor; 
     4  this.originalSizes = null; 
    45  editor._superclean_on = false; 
    56  var cfg = editor.config; 
     
    5455    // Width & Height of window 
    5556    var dim = Xinha.viewportSize(); 
     57    if(e.config.fullScreenSizeDownMethod == 'restore')  
     58    { 
     59      e.originalSizes = { 
     60        x:   parseInt(e._htmlArea.style.width), 
     61        y:   parseInt(e._htmlArea.style.height), 
     62        dim: dim 
     63      }; 
     64    } 
    5665 
    5766    var h = dim.y - e.config.fullScreenMargins[0] -  e.config.fullScreenMargins[2]; 
     
    6776    if(e._isFullScreen || e._sizing) return false; 
    6877    e._sizing = true; 
    69     e.initSize(); 
     78 
     79    if(e.originalSizes != null)  
     80    { 
     81        var os = e.originalSizes; 
     82        var nDim = Xinha.viewportSize(); 
     83        var nW = os.x + (nDim.x - os.dim.x); 
     84        var nH = os.y + (nDim.y - os.dim.y); 
     85        e.sizeEditor( nW + 'px', nH + 'px', e.config.sizeIncludesBars, e.config.sizeIncludesPanels); 
     86        e.originalSizes = null; 
     87    } 
     88    else e.initSize(); 
     89 
    7090    e._sizing = false; 
    7191    if ( e._toolbarObjects.fullscreen ) e._toolbarObjects.fullscreen.swapImage(cfg.iconList.fullscreen);  
Note: See TracChangeset for help on using the changeset viewer.