r114031 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114030‎ | r114031 | r114032 >
Date:20:18, 16 March 2012
Author:rmoen
Status:deferred
Tags:
Comment:
adapt LinkInspector to use surfaceObserver for selection
Modified paths:
  • /trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/ve/ui/inspectors/ve.ui.LinkInspector.js (modified) (history)
  • /trunk/extensions/VisualEditor/modules/ve/ui/tools/ve.ui.AnnotationButtonTool.js (modified) (history)

Diff [purge]

Index: trunk/extensions/VisualEditor/modules/ve/ce/ve.ce.Surface.js
@@ -31,7 +31,6 @@
3232 // Surface Observer
3333 this.surfaceObserver = new ve.ce.SurfaceObserver( this.documentView );
3434 this.surfaceObserver.on( 'select', function( selection ) {
35 -
3635 if ( selection !== null ) {
3736 // Keep a copy of the current selection on hand
3837 _this.currentSelection = selection.clone();
Index: trunk/extensions/VisualEditor/modules/ve/ui/tools/ve.ui.AnnotationButtonTool.js
@@ -23,8 +23,8 @@
2424 ve.ui.AnnotationButtonTool.prototype.onClick = function() {
2525 var surfaceView = this.toolbar.getSurfaceView();
2626 if ( this.inspector ) {
27 - if ( surfaceView.getModel().getSelection().getLength() ) {
28 - this.toolbar.getSurfaceView().getContextView().openInspector( this.inspector );
 27+ if( surfaceView.surfaceObserver.range.getLength() ) {
 28+ this.toolbar.getSurfaceView().contextView.openInspector( this.inspector );
2929 } else {
3030 if ( this.active ) {
3131 var surfaceModel = surfaceView.getModel(),
Index: trunk/extensions/VisualEditor/modules/ve/ui/inspectors/ve.ui.LinkInspector.js
@@ -8,7 +8,6 @@
99 ve.ui.LinkInspector = function( toolbar, context ) {
1010 // Inheritance
1111 ve.ui.Inspector.call( this, toolbar, context );
12 -
1312 // Properties
1413 this.$clearButton = $( '<div class="es-inspector-button es-inspector-clearButton"></div>' )
1514 .prependTo( this.$ );

Status & tagging log