devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
23 lines (22 loc) • 934 B
JavaScript
import { CommandBase } from '../command-base';
import { SimpleCommandState } from '../command-states';
export class ToggleShowHiddenSymbolsCommand extends CommandBase {
getState() {
return new SimpleCommandState(this.isEnabled(), this.control.innerClientProperties.showHiddenSymbols);
}
DEPRECATEDConvertOptionsParameter(parameter) {
return typeof parameter === 'boolean' ? parameter : !this.control.innerClientProperties.showHiddenSymbols;
}
executeCore(_state, options) {
let newValue = options.param;
if (newValue !== this.control.innerClientProperties.showHiddenSymbols) {
this.control.innerClientProperties.showHiddenSymbols = newValue;
this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
return true;
}
return false;
}
isEnabledInReadOnlyMode() {
return true;
}
}