Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const onLeftOrRightInMenu = (comp: AlloyComponent, se: SimulatedEvent) => {
// The originating dropdown is stored on the sandbox itself.
const dropdown: AlloyComponent = Representing.getValue(comp);
// Focus the dropdown. Current workaround required to make flow recognise the current focus
Focusing.focus(dropdown);
AlloyTriggers.emitWith(dropdown, 'keydown', {
raw: se.event().raw()
});
// Close the dropdown
AlloyDropdown.close(dropdown);
return Option.some(true);
};const emit = (comp: AlloyComponent, event: string, data: Object): void => {
AlloyTriggers.emitWith(comp, event, data);
};onItemExecute: (typeahead, _sandbox, _item, _value) => {
updateHistory(typeahead);
AlloyTriggers.emitWith(typeahead, formChangeEvent, { name: spec.name });
}
});onChangeTab: (section, button, _viewItems) => {
const title = Representing.getValue(button);
AlloyTriggers.emitWith(section, formTabChangeEvent, {
title,
oldTitle: oldTab.get()
});
oldTab.set(title);
},getButton().getOpt(sink).each((orig) => {
Focus.focus(orig.element());
AlloyTriggers.emitWith(orig, formActionEvent, {
name: item.name,
value: item.storage.get()
});
});
});createButton('Redo', 'redo', true, (button) => {
AlloyTriggers.emitWith(button, ImageToolsEvents.internal.redo(), {
direction: 1
});
}, providersBackstage)
);picker(urlData).get((chosenData) => {
Representing.setValue(field, chosenData);
AlloyTriggers.emitWith(comp, formChangeEvent, { name: spec.name });
});
});return ToolbarScopes.categorise(registryContextToolbars, (toolbarApi) => {
const alloySpec = buildToolbar(toolbarApi);
AlloyTriggers.emitWith(contextbar, forwardSlideEvent, {
forwardContents: wrapInPopDialog(alloySpec)
});
});
});onChangeTab: (section, button, _viewItems) => {
const name = Representing.getValue(button);
AlloyTriggers.emitWith(section, formTabChangeEvent, {
name,
oldName: oldTab.get()
});
oldTab.set(name);
},