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
staticModalOpen:string
Fires when the editor is opened in a modal window.
ModalClose
staticModalClose:string
Fires when the editor is closed in a modal window.
FullWindow
staticFullWindow:string
Fires when the editor is switched to the full window mode.
FullScreen
staticFullScreen:string
Fires when the editor is switched to the full screen mode.
OriginalSize
staticOriginalSize:string
Fires when the editor is switched to the original size mode.
AssetManagerOpened
staticAssetManagerOpened:string
Fires when the Image Manager opens.
AssetManagerClosed
staticAssetManagerClosed:string
Fires when the Image Manager closes.
RevertProduct
staticRevertProduct:string
Fires when a user reverts a product in the editor.
OnSurfaceChanged
staticOnSurfaceChanged:string
Fires when a user switches surfaces.
CanUndoChanged
staticCanUndoChanged:string
Fires when the Undo button gets enabled in the editor.
CanRedoChanged
staticCanRedoChanged:string
Fires when the Redo button gets enabled in the editor.
OnImageDpiChanged
staticOnImageDpiChanged:string
Fires when a user resizes images.
PopupOpen
staticPopupOpen:string
Fires when a dialog box opens.
Deprecated
Instead, subscribe to Events.UIElementStateChange with the TextPopup argument.
PrintAreaBoundsChanged
staticPrintAreaBoundsChanged:string
Fires when the size of a print area changes, for example, after using Surface.setPrintAreas|`setPrintAreas()`.
UndoProduct
staticUndoProduct:string
Fires when a user clicks the Undo button.
RedoProduct
staticRedoProduct:string
Fires when a user clicks the Redo button.
BoundsNotification
staticBoundsNotification:string="BoundsNotification"
Allows for getting product measurements during customization.
ItemChanged
staticItemChanged:string="ItemChanged"
Fires when the design element is changed in the editor.
ItemAdded
staticItemAdded:string="ItemAdded"
Fires when a design element is added to the product.
ItemRemoved
staticItemRemoved:string="ItemRemoved"
Fires when a design element is removed from the product.
SelectedItemsChanged
staticSelectedItemsChanged:string="SelectedItemsChanged"
Fires when a design element from the collection is changed in the editor.
UIElementStateChange
staticUIElementStateChange: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
staticCustomButtonClicked:string
Fires when the custom button clicked.
ObjectInspectorVisibilityChange
staticObjectInspectorVisibilityChange:string
Fires when ObjectInspector is opened or closed in the editor.