Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function _handleChangeForHeader(editor: Editor, props: RoosterCommandBarProps, state: RoosterCommandBarState): void {
if (state.formatState.headerLevel === this.headerLevel) {
toggleHeader(editor, 0);
} else {
toggleHeader(editor, this.headerLevel);
}
}
document.getElementById('header').addEventListener('change', function() {
let select = document.getElementById('header') as HTMLSelectElement;
let level = parseInt(select.value);
toggleHeader(getCurrentEditor(), level);
select.value = '-1';
});
onClick: (editor, value) => toggleHeader(editor, parseInt(value)),
dropDownItems: {
function _handleChangeForHeader(editor: Editor, props: RoosterCommandBarProps, state: RoosterCommandBarState): void {
if (state.formatState.headerLevel === this.headerLevel) {
toggleHeader(editor, 0);
} else {
toggleHeader(editor, this.headerLevel);
}
}