mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
19 lines
550 B
JavaScript
19 lines
550 B
JavaScript
es.ClearButtonTool = function( toolbar ) {
|
|
es.ButtonTool.call( this, toolbar, 'clear' );
|
|
};
|
|
|
|
es.ClearButtonTool.prototype.updateState = function( selection, annotations ) {
|
|
};
|
|
|
|
es.ClearButtonTool.prototype.onClick = function() {
|
|
var tx = this.toolbar.surfaceView.model.getDocument().prepareContentAnnotation(
|
|
this.toolbar.surfaceView.currentSelection,
|
|
'clear',
|
|
/.*/
|
|
);
|
|
this.toolbar.surfaceView.model.transact( tx );
|
|
};
|
|
|
|
es.ToolbarView.tools.clear = es.ClearButtonTool;
|
|
|
|
es.extendClass( es.ClearButtonTool, es.ButtonTool ); |