@progress/kendo-angular-editor
Version:
Kendo UI Editor for Angular
34 lines (33 loc) • 1.34 kB
JavaScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { EditorCommandBaseDirective } from './editor-command-base';
import { take } from 'rxjs/operators';
/**
* @hidden
*/
export class EditorCommandDialog extends EditorCommandBaseDirective {
dialog;
button;
localization;
providerService;
toolsService;
constructor(dialog, button, localization, providerService, toolsService) {
super(dialog, button, localization, providerService, toolsService);
this.dialog = dialog;
this.button = button;
this.localization = localization;
this.providerService = providerService;
this.toolsService = toolsService;
}
clickHandler() {
this.editor.openDialog(this.dialog);
}
onStateChange(toolBarState) {
this.providerService.editor.ngZone.onStable.pipe(take(1)).subscribe(() => {
this.button.selected = toolBarState[this.command].selected;
this.button.disabled = toolBarState[this.command].disabled;
});
}
}