Skip to content

Komodo 9 Changes Data DOM Events

Nathan Rijksen edited this page Aug 13, 2015 · 5 revisions

Komodo 8

Komodo 8 was using DataContainerEvent (which are now deprecated in the Mozilla platform) to send application events, allowing applications to listen and use the getData() call to get custom properties on these events, example:

// Send the event
var evt = document.createEvent("DataContainerEvent");
evt.initEvent("myevent", true /*bubble*/ , true /*cancelable*/);
evt.setData('foo', 'somevalue');
window.dispatchEvent(evt);

// Handle the event
function event_handler(event) {
  event.getData('foo');
}
window.addEventListener("myevent", event_handler);

Komodo 9

In Komodo 9, these have been changed to use CustomEvent, which has a different setup/retrieval methods for the custom data, example:

// Send the event
var evt = new CustomEvent("myevent",
                          {
                            bubbles: true,
                            cancelable: true,
                            detail: { 'foo', 'somevalue' }
                          });
window.dispatchEvent(evt);

// Handle the event
function event_handler(event) {
  event.detail['foo'];
}
window.addEventListener("myevent", event_handler);

Affect Events

This is the list of Komodo events that have been changed to use CustomEvent:

  • file_saved
  • current_view_linecol_changed
  • current_view_scroll_changed
  • scintilla-add-char
  • codeintel_autocomplete_showing
  • codeintel_autocomplete_selected
  • codeintel_userlist_selected
  • bookmark_added
  • bookmark_deleted
  • ko-widget-showing
  • ko-widget-hidden
  • ko-widget-insert
  • ko-widget-move
  • ko-widget-move-completed
  • ko-widget-remove
  • ko-widget-remove-completed
  • loadDialog