devexpress-richedit
Version:
DevExpress Rich Text Editor is an advanced word-processing tool designed for working with rich text documents.
23 lines (22 loc) • 826 B
JavaScript
import { ControlOptions } from '../../model/options/control';
import { CommandBase } from '../command-base';
import { SimpleCommandState } from '../command-states';
export class ToggleFullScreenCommand extends CommandBase {
getState() {
var state = new SimpleCommandState(this.isEnabled());
state.value = this.control.owner.isInFullScreenMode;
return state;
}
executeCore(_state, options) {
if (options.param == this.control.owner.isInFullScreenMode)
return false;
this.control.owner.toggleFullScreenMode();
return true;
}
isEnabled() {
return super.isEnabled() && ControlOptions.isEnabled(this.control.modelManager.richOptions.control.fullScreen);
}
isEnabledInReadOnlyMode() {
return true;
}
}