Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const updateEditorClasses = (editor: Editor, docked: boolean) => {
const editorContainer = Element.fromDom(editor.getContainer());
if (docked) {
Class.add(editorContainer, editorStickyOnClass);
Class.remove(editorContainer, editorStickyOffClass);
} else {
Class.add(editorContainer, editorStickyOffClass);
Class.remove(editorContainer, editorStickyOnClass);
}
};
SelectorFind.descendant(comp.element(), '.' + ItemClasses.activeClass).each((currentActive) => {
Class.remove(currentActive, ItemClasses.activeClass);
});
Class.add(tgt, ItemClasses.activeClass);
const toggleClass = (elm: Element, cls: string, state: boolean) => {
if (Class.has(elm, cls) && state === false) {
Class.remove(elm, cls);
} else if (state) {
Class.add(elm, cls);
}
};
const updateSinkVisibility = (sinkElem: Element, visible: boolean): void => {
if (visible) {
Class.remove(sinkElem, visibility.fadeOutClass);
Classes.add(sinkElem, [ visibility.transitionClass, visibility.fadeInClass ]);
} else {
Class.remove(sinkElem, visibility.fadeInClass);
Classes.add(sinkElem, [ visibility.fadeOutClass, visibility.transitionClass ]);
}
};
const toggleClass = (elm: Element, cls: string, state: boolean) => {
if (Class.has(elm, cls) && state === false) {
Class.remove(elm, cls);
} else if (state) {
Class.add(elm, cls);
}
};
dockInfo.contextual.each((contextInfo) => {
if (Compare.eq(component.element(), simulatedEvent.event().target())) {
Class.remove(component.element(), contextInfo.transitionClass);
simulatedEvent.stop();
}
});
}),
const updateSinkVisibility = (sinkElem: Element, visible: boolean): void => {
if (visible) {
Class.remove(sinkElem, visibility.fadeOutClass);
Classes.add(sinkElem, [ visibility.transitionClass, visibility.fadeInClass ]);
} else {
Class.remove(sinkElem, visibility.fadeInClass);
Classes.add(sinkElem, [ visibility.fadeOutClass, visibility.transitionClass ]);
}
};