r104780 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104779‎ | r104780 | r104781 >
Date:23:19, 30 November 2011
Author:tparscal
Status:deferred
Tags:
Comment:
Made context icon update with selection updates
Modified paths:
  • /trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/es/views/es.ContextView.js
@@ -34,6 +34,12 @@
3535
3636 /* Methods */
3737
 38+es.ContextView.prototype.update = function() {
 39+ if ( this.$icon.is( ':visible' ) ) {
 40+ this.set();
 41+ }
 42+};
 43+
3844 es.ContextView.prototype.set = function() {
3945 this.$.removeClass(
4046 'es-contextView-position-below es-contextView-position-above ' +
Index: trunk/extensions/VisualEditor/modules/es/views/es.SurfaceView.js
@@ -147,6 +147,8 @@
148148 if ( _this.currentSelection.from !== _this.currentSelection.to ) {
149149 _this.hideCursor();
150150 _this.documentView.drawSelection( _this.currentSelection );
 151+ // Update the context icon position
 152+ _this.contextView.update();
151153 } else {
152154 _this.showCursor();
153155 _this.documentView.clearSelection( _this.currentSelection );
@@ -157,6 +159,8 @@
158160 if ( this.currentSelection.from !== this.currentSelection.to ) {
159161 this.hideCursor();
160162 this.documentView.drawSelection( this.currentSelection );
 163+ // Update the context icon position
 164+ this.contextView.update();
161165 } else {
162166 this.showCursor();
163167 this.documentView.clearSelection( this.currentSelection );

Status & tagging log