Source: xxe/editor/DocumentMarksChangedEvent.js

  1. export const CHANGE_NODE_MARK_ADDED = 0;
  2. export const CHANGE_NODE_MARK_MOVED = 1;
  3. export const CHANGE_NODE_MARK_REMOVED = 2;
  4. export const CHANGE_TEXT_LOCATION_ADDED = 3;
  5. export const CHANGE_TEXT_LOCATION_MOVED = 4;
  6. export const CHANGE_TEXT_LOCATION_REMOVED = 5;
  7. /**
  8. * {@link XMLEditorEvent} sent after some documents are changed
  9. * on the server side.
  10. */
  11. export class DocumentMarksChangedEvent extends XMLEditorEvent {
  12. constructor(xmlEditor, data) {
  13. super(xmlEditor, data, "documentMarksChanged");
  14. }
  15. /**
  16. * Get the <code>changes</code> property of this event.
  17. *
  18. * @type {array}
  19. */
  20. get changes() {
  21. return this._changes;
  22. }
  23. /**
  24. * Get the <code>reason</code> property of this event.
  25. *
  26. * @type {string}
  27. */
  28. get reason() {
  29. // Return null rather than undefined.
  30. return !this._reason? null : this._reason;
  31. }
  32. /**
  33. * Get the <code>dragging</code> property of this event.
  34. *
  35. * @type {boolean}
  36. */
  37. get dragging() {
  38. return (this._reason === "dragging");
  39. }
  40. /**
  41. * Get the <code>showing</code> property of this event.
  42. *
  43. * @type {boolean}
  44. */
  45. get showing() {
  46. return (this._reason === "showing");
  47. }
  48. }