Skip to main content

Class: Events

Events supported in the Design Editor.

Remarks

To subscribe to an event, use the (Editor:class).subscribe|`subscribe()` method.

Example

const editor = await CustomersCanvas.IframeApi.loadEditor(iframe, productDefinition);

editor.subscribe(CustomersCanvas.IframeApi.PostMessage.Events.BoundsNotification, (args) => {
console.log("BoundsNotification was triggered.");
console.log(JSON.stringify(args, null, 4));

editor.subscribe(CustomersCanvas.IframeApi.PostMessage.Events.PrintAreaBoundsChanged, (args) => {
console.log("PrintAreaBoundsChanged");
console.log(args);
});

Constructors

Constructor

new Events(): Events

Returns

Events

Properties

ModalOpen

static ModalOpen: string

Fires when the editor is opened in a modal window.


ModalClose

static ModalClose: string

Fires when the editor is closed in a modal window.


FullWindow

static FullWindow: string

Fires when the editor is switched to the full window mode.


FullScreen

static FullScreen: string

Fires when the editor is switched to the full screen mode.


OriginalSize

static OriginalSize: string

Fires when the editor is switched to the original size mode.


AssetManagerOpened

static AssetManagerOpened: string

Fires when the Image Manager opens.


AssetManagerClosed

static AssetManagerClosed: string

Fires when the Image Manager closes.


RevertProduct

static RevertProduct: string

Fires when a user reverts a product in the editor.


OnSurfaceChanged

static OnSurfaceChanged: string

Fires when a user switches surfaces.


CanUndoChanged

static CanUndoChanged: string

Fires when the Undo button gets enabled in the editor.


CanRedoChanged

static CanRedoChanged: string

Fires when the Redo button gets enabled in the editor.


OnImageDpiChanged

static OnImageDpiChanged: string

Fires when a user resizes images.


PopupOpen

static PopupOpen: string

Fires when a dialog box opens.

Deprecated

Instead, subscribe to Events.UIElementStateChange with the TextPopup argument.


PrintAreaBoundsChanged

static PrintAreaBoundsChanged: string

Fires when the size of a print area changes, for example, after using Surface.setPrintAreas|`setPrintAreas()`.


UndoProduct

static UndoProduct: string

Fires when a user clicks the Undo button.


RedoProduct

static RedoProduct: string

Fires when a user clicks the Redo button.


BoundsNotification

static BoundsNotification: string = "BoundsNotification"

Allows for getting product measurements during customization.


ItemChanged

static ItemChanged: string = "ItemChanged"

Fires when the design element is changed in the editor.


ItemAdded

static ItemAdded: string = "ItemAdded"

Fires when a design element is added to the product.


ItemRemoved

static ItemRemoved: string = "ItemRemoved"

Fires when a design element is removed from the product.


SelectedItemsChanged

static SelectedItemsChanged: string = "SelectedItemsChanged"

Fires when a design element from the collection is changed in the editor.


UIElementStateChange

static UIElementStateChange: string

Fires when TextPopup, BottomToolbar.Zoom, or BottomToolbar.Settings popups is opened or closed in the editor. UIElementStateChangeEventArgs|Arguments of this event look as follows: {element: "BottomToolbar.Zoom", isOpen: true}.


CustomButtonClicked

static CustomButtonClicked: string

Fires when the custom button clicked.


ObjectInspectorVisibilityChange

static ObjectInspectorVisibilityChange: string

Fires when ObjectInspector is opened or closed in the editor.

Was this page helpful?