Ticket #1262: Xinha-SizeItDown.js.patch

File Xinha-SizeItDown.js.patch, 2.8 kB (added by guest, 4 years ago)

Xinha Fullscreen module SizeItDown? patch

  • modules/FullScreen/full-screen.js

     
    11function FullScreen(editor, args) 
    22{ 
    33  this.editor = editor; 
     4  this.originalSizes = null; 
    45  editor._superclean_on = false; 
    56  cfg = editor.config; 
    67 
     
    4950    e._sizing = true; 
    5051    // Width & Height of window 
    5152    var dim = Xinha.viewportSize(); 
     53    if(e.config.fullScreenSizeDownMethod == 'restore')  
     54    { 
     55      e.originalSizes = { 
     56        x:   parseInt(e._htmlArea.style.width), 
     57        y:   parseInt(e._htmlArea.style.height), 
     58        dim: dim 
     59      }; 
     60    } 
    5261 
    5362    var h = dim.y - e.config.fullScreenMargins[0] -  e.config.fullScreenMargins[2]; 
    5463    var w = dim.x - e.config.fullScreenMargins[1] -  e.config.fullScreenMargins[3]; 
     
    6271  { 
    6372    if(e._isFullScreen || e._sizing) return false; 
    6473    e._sizing = true; 
    65     e.initSize(); 
     74 
     75    if(e.originalSizes != null)  
     76    { 
     77        var os = e.originalSizes; 
     78        var nDim = Xinha.viewportSize(); 
     79        var nW = os.x + (nDim.x - os.dim.x); 
     80        var nH = os.y + (nDim.y - os.dim.y); 
     81        e.sizeEditor( nW + 'px', nH + 'px', e.config.sizeIncludesBars, e.config.sizeIncludesPanels); 
     82        e.originalSizes = null; 
     83    } 
     84    else e.initSize(); 
     85 
    6686    e._sizing = false; 
    6787    if ( e._toolbarObjects.fullscreen ) e._toolbarObjects.fullscreen.swapImage([_editor_url + cfg.imgURL + 'ed_buttons_main.gif',8,0]);  
    6888  } 
  • XinhaCore.js

     
    853853   */ 
    854854  this.fullScreenMargins = [0,0,0,0]; 
    855855   
     856   
     857  /** Specify the method that is being used to calculate the editor's size<br/> 
     858    * when we return from fullscreen mode. 
     859    *  There are two choices: 
     860    *  
     861    * <table border="1"> 
     862    *   <tr> 
     863    *       <td><em>initSize</em></td> 
     864    *       <td>Use the internal Xinha.initSize() method to calculate the editor's  
     865    *       dimensions. This is suitable for most usecases.</td> 
     866    *   </tr> 
     867    *   <tr> 
     868    *       <td><em>restore</em></td> 
     869    *       <td>The editor's dimensions will be stored before going into fullscreen 
     870    *       mode and restored when we return to normal mode, taking a possible 
     871    *       window resize during fullscreen in account.</td> 
     872    *     </tr> 
     873    * </table> 
     874    * 
     875    * Default: <code>"initSize"</code> 
     876    * @type String 
     877    */ 
     878  this.fullScreenSizeDownMethod = 'initSize'; 
     879   
    856880  /** This array orders all buttons except plugin buttons in the toolbar. Plugin buttons typically look for one  
    857881   *  a certain button in the toolbar and place themselves next to it. 
    858882   * Default value: