r63509 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63508‎ | r63509 | r63510 >
Date:21:25, 9 March 2010
Author:dale
Status:deferred
Tags:
Comment:
fixed fullscreen position to use scroll offset
Modified paths:
  • /branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js (modified) (history)
  • /branches/js2-work/phase3/js/uploadPage.js (modified) (history)

Diff [purge]

Index: branches/js2-work/phase3/js/mwEmbed/skins/ctrlBuilder.js
@@ -211,6 +211,7 @@
212212 }
213213 var offsetTop = ( targetHeight < fullHeight )? ( fullHeight- targetHeight ) / 2 : 0;
214214 var offsetLeft = ( targetWidth < fullWidth )? ( fullWidth- targetWidth ) / 2 : 0;
 215+
215216 //mw.log(" targetWidth: " + targetWidth + ' fullwidth: ' + fullWidth + ' :: ' + ( fullWidth- targetWidth ) / 2 );
216217 return {
217218 'height': targetHeight,
@@ -301,10 +302,17 @@
302303 this.windowPositionStyle = $interface.css( 'position' );
303304 this.windowZindex = $interface.css( 'z-index' );
304305
 306+ // Get the base offset:
 307+ this.windowOffset = $interface.offset();
 308+ this.windowOffset.top = this.windowOffset.top - $j(document).scrollTop();
 309+ this.windowOffset.left = this.windowOffset.left - $j(document).scrollLeft();
 310+
305311 // Change the z-index of the interface
306312 $interface.css( {
307313 'position' : 'fixed',
308 - 'z-index' : mw.getConfig( 'fullScreenIndex' ) + 1
 314+ 'z-index' : mw.getConfig( 'fullScreenIndex' ) + 1,
 315+ 'top' : this.windowOffset.top,
 316+ 'left' : this.windowOffset.left
309317 } );
310318
311319
@@ -315,8 +323,7 @@
316324 // Hide the body scroll bar
317325 $j('body').css( 'overflow', 'hidden' );
318326
319 - // Get the base offset:
320 - this.windowOffset = $interface.offset();
 327+
321328 var topOffset = '0px';
322329 var leftOffset = '0px';
323330
Index: branches/js2-work/phase3/js/uploadPage.js
@@ -24,7 +24,7 @@
2525 'apiUrl': mw.getLocalApiUrl(),
2626
2727 // MediaWiki API supports chunk uploads:
28 - 'enable_chunks' : false,
 28+ 'enable_chunks' : false,
2929
3030 // Set the interface type
3131 'interface_type' : 'dialog',
@@ -75,6 +75,7 @@
7676 .focus( function() {
7777 _this.toggleUpType( this.id == 'wpUploadFile' );
7878 } )
 79+
7980 // Also setup the onChange event binding:
8081 .change( function() {
8182 if ( wgUploadAutoFill ) {

Status & tagging log