Event Author API

itemduplicate:confirm

Fires after an author has confirmed the duplication of an Item containing a shared passage.

You would want to be notified about this event firing, because you might want to make a copy of the shared passage before the author confirms the duplication of the Item, for example.

When duplicating an Item, a confirmation dialog is displayed when a shared passage is present in the Item, giving the author a choice of duplicating the Item or cancelling the action.

Examples

authorApp.on('itemduplicate:confirm', function (itemJson) {
    console.log('This code executes when the author has confirmed the duplication of an Item containing a shared passage.');
    console.log(itemJson);
});

Callback arguments

The event callback function will be called with an AuthorEvent instance as an argument (unless indicated otherwise). The AuthorEvent object provides further information for the event that has been fired. Additional data attributes listed below can be accessed from the event.data object. The AuthorEvent object will look like the example below:

authorApp.on('[name of the fired event]', function (event) {
    console.log(event);
    /*
        {
            "name": "[name of the fired event]",
            "data": {
                // additional data attributes
            }
        }
    */
});
  • itemJson object
    JSON of the Item being duplicated.

Related articles

  • The duplicateItem() method, which duplicates the current Item being edited.
Was this article helpful?