Documentation Center

stopPropagation

Description

Stops the event from propagating to higher level nodes. Can be used instead of the bubbles property on events.

var doc = Editor.getActiveDocument();
doc.addEventListener("XopusBeforeSubtreeModified", function (evt) {
  // listening to all changes in the entire document
  // this will not be executed for changes in the first paragraph, due to the stopPropagation call in the event listener below
});
var p = doc.selectSingleNode("//paragraph[1]");
p.addEventListener("XopusBeforeSubtreeModified", function (evt) {
  // listening to changes in the first paragraph
  // below call will stop any further processing of this event higher up in the DOM
  evt.stopPropagation();
});

Syntax

XopusEvent.stopPropagation ()