How to use the @ephox/alloy.AlloyTriggers.emitWith function in @ephox/alloy

To help you get started, we’ve selected a few @ephox/alloy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dropdown / CommonDropdown.ts View on Github external
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);
  };
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dialog / imagetools / EditPanel.ts View on Github external
const emit = (comp: AlloyComponent, event: string, data: Object): void => {
    AlloyTriggers.emitWith(comp, event, data);
  };
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dialog / UrlInput.ts View on Github external
onItemExecute: (typeahead, _sandbox, _item, _value) => {
      updateHistory(typeahead);
      AlloyTriggers.emitWith(typeahead, formChangeEvent, { name: spec.name });
    }
  });
github tinymce / tinymce / src / themes / silver / main / ts / ui / dialog / TabPanel.ts View on Github external
onChangeTab: (section, button, _viewItems) => {
      const title = Representing.getValue(button);
      AlloyTriggers.emitWith(section, formTabChangeEvent, {
        title,
        oldTitle: oldTab.get()
      });
      oldTab.set(title);
    },
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / button / MenuButton.ts View on Github external
getButton().getOpt(sink).each((orig) => {
          Focus.focus(orig.element());
          AlloyTriggers.emitWith(orig, formActionEvent, {
            name: item.name,
            value: item.storage.get()
          });
        });
      });
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dialog / imagetools / SideBar.ts View on Github external
createButton('Redo', 'redo', true, (button) => {
      AlloyTriggers.emitWith(button, ImageToolsEvents.internal.redo(), {
        direction: 1
      });
    }, providersBackstage)
  );
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dialog / UrlInput.ts View on Github external
picker(urlData).get((chosenData) => {
          Representing.setValue(field, chosenData);
          AlloyTriggers.emitWith(comp, formChangeEvent, { name: spec.name });
        });
      });
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ContextToolbar.ts View on Github external
return ToolbarScopes.categorise(registryContextToolbars, (toolbarApi) => {
      const alloySpec = buildToolbar(toolbarApi);
      AlloyTriggers.emitWith(contextbar, forwardSlideEvent, {
        forwardContents: wrapInPopDialog(alloySpec)
      });
    });
  });
github tinymce / tinymce / modules / tinymce / src / themes / silver / main / ts / ui / dialog / TabPanel.ts View on Github external
onChangeTab: (section, button, _viewItems) => {
      const name = Representing.getValue(button);
      AlloyTriggers.emitWith(section, formTabChangeEvent, {
        name,
        oldName: oldTab.get()
      });
      oldTab.set(name);
    },