mediawiki-extensions-Visual.../modules/es/tools/es.ClearButtonTool.js

19 lines
550 B
JavaScript
Raw Normal View History

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 );