r106127 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r106126‎ | r106127 | r106128 >
Date:23:22, 13 December 2011
Author:tparscal
Status:ok
Tags:
Comment:
Added blur handler for window which resets the shift key tracker
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js
@@ -132,29 +132,34 @@
133133 }, 0 );
134134 }
135135 } );
136 - $window.resize( function() {
137 - // Re-render when resizing horizontally
138 - // TODO: Instead of re-rendering on every single 'resize' event wait till user is done with
139 - // resizing - can be implemented with setTimeout
140 - _this.hideCursor();
141 - _this.dimensions.height = $window.height();
142 - // XXX: This is a dirty hack!
143 - _this.dimensions.toolbarHeight = $( '#es-toolbar' ).height();
144 - var width = _this.$.width();
145 - if ( _this.dimensions.width !== width ) {
146 - _this.dimensions.width = width;
147 - _this.documentView.renderContent();
148 - _this.emitUpdate( 25 );
149 - }
150 - } );
151 - $window.scroll( function() {
152 - _this.dimensions.scrollTop = $window.scrollTop();
153 - if ( _this.contextView ) {
154 - if ( _this.currentSelection.getLength() && !_this.mouse.selectingMode ) {
155 - _this.contextView.set();
156 - } else {
157 - _this.contextView.clear();
 136+ $window.bind( {
 137+ 'resize': function() {
 138+ // Re-render when resizing horizontally
 139+ // TODO: Instead of re-rendering on every single 'resize' event wait till user is done
 140+ // with resizing - can be implemented with setTimeout
 141+ _this.hideCursor();
 142+ _this.dimensions.height = $window.height();
 143+ // XXX: This is a dirty hack!
 144+ _this.dimensions.toolbarHeight = $( '#es-toolbar' ).height();
 145+ var width = _this.$.width();
 146+ if ( _this.dimensions.width !== width ) {
 147+ _this.dimensions.width = width;
 148+ _this.documentView.renderContent();
 149+ _this.emitUpdate( 25 );
158150 }
 151+ },
 152+ 'scroll': function() {
 153+ _this.dimensions.scrollTop = $window.scrollTop();
 154+ if ( _this.contextView ) {
 155+ if ( _this.currentSelection.getLength() && !_this.mouse.selectingMode ) {
 156+ _this.contextView.set();
 157+ } else {
 158+ _this.contextView.clear();
 159+ }
 160+ }
 161+ },
 162+ 'blur': function() {
 163+ _this.keyboard.keys.shift = false;
159164 }
160165 } );
161166

Follow-up revisions

RevisionCommit summaryAuthorDate
r106249MFT r106123, r106124, r106127, r106157, r106224, r106230 misc fixes to common...neilk21:58, 14 December 2011

Status & tagging log