Skip to content

Events


Design Loaded

This event is called when your design is loaded in the editor.

unlayer.addEventListener('design:loaded', function(data) {
  // Design is loaded
  var json = data.design; // design json
})

Design Updated

This event is called when the user changes anything in the editor.

unlayer.addEventListener('design:updated', function(data) {
  // Design is updated by the user
  var type = data.type; // body, row, content
  var item = data.item;
  var changes = data.changes;
  console.log('design:updated', type, item, changes);
})

Image Uploaded

This event is called when an image is uploaded by the user.

unlayer.addEventListener('onImageUpload', function(data) {
  var image = data.image;
  var url = image.url;
  var width = image.width;
  var height = image.height;
})