r105944 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r105943‎ | r105944 | r105945 >
Date:22:33, 12 December 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed scroll jumping issue in Chrome (at least)
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.ToolbarView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.ToolbarView.js
@@ -24,21 +24,21 @@
2525 * keyboard or mouse).
2626 */
2727 $window.scroll( function() {
28 - if ( _this.surfaceView.dimensions.scrollTop >= _this.surfaceView.dimensions.toolbarTop ) {
29 - if ( ! _this.$.hasClass( 'float' ) ) {
 28+ if ( _this.surfaceView.dimensions.scrollTop > _this.surfaceView.dimensions.toolbarTop ) {
 29+ if ( !_this.$.hasClass( 'float' ) ) {
3030 var left = _this.$.offset().left,
3131 right = $window.width() - _this.$.outerWidth() - left;
3232 _this.$.css( 'right', right );
3333 _this.$.css( 'left', left );
 34+ _this.$spacer.height( _this.$.height() );
3435 _this.$.addClass( 'float' );
35 - _this.$spacer.height( _this.$.height() );
3636 }
3737 } else {
3838 if ( _this.$.hasClass( 'float' ) ) {
3939 _this.$.css( 'right', 0 );
4040 _this.$.css( 'left', 0 );
 41+ _this.$spacer.height(0);
4142 _this.$.removeClass( 'float' );
42 - _this.$spacer.height(0);
4343 }
4444 }
4545 } );

Status & tagging log