Index: trunk/extensions/VisualEditor/modules/ve/ui/tools/ve.ui.ClearButtonTool.js |
— | — | @@ -19,16 +19,11 @@ |
20 | 20 | /* Methods */ |
21 | 21 | |
22 | 22 | ve.ui.ClearButtonTool.prototype.onClick = function() { |
23 | | - var surfaceView = this.toolbar.getSurfaceView(), |
24 | | - surfaceModel = surfaceView.getModel(), |
25 | | - tx =surfaceModel.getDocument().prepareContentAnnotation( |
26 | | - surfaceView.currentSelection, |
27 | | - 'clear', |
28 | | - this.pattern |
29 | | - ); |
30 | | - surfaceModel.transact( tx ); |
| 23 | + var surfaceView = this.toolbar.getSurfaceView(); |
| 24 | + |
| 25 | + surfaceView.annotate( 'clear', this.pattern ); |
31 | 26 | surfaceView.clearInsertionAnnotations(); |
32 | | - surfaceView.getContextView().closeInspector(); |
| 27 | + surfaceView.contextView.closeInspector(); |
33 | 28 | }; |
34 | 29 | |
35 | 30 | ve.ui.ClearButtonTool.prototype.updateState = function( annotations ) { |