Updates the internal status of the specified view to override its status indicating whether it has any unsaved changes.
You would want to use this method so that you can update the specified view's state when saving Items externally in your own application.
// Update the saveable state of the current Item to true var hasUpdatedStatus = authorApp.setSafeToUnload('item_edit'); console.log(hasUpdatedStatus); // Update the saveable state of the current Item to false, indicating there are unsaved changes var hasUpdatedStatus = authorApp.setSafeToUnload('item_edit', false); console.log(hasUpdatedStatus);
The name of the component. Supported component names are:
trueor omitted, the specified
componentNamestate is marked as safe to unload. This is necessary if saving Items is done externally.
false, the specified
componentNamestate is marked as not safe to unload.
true if the method call succeeded, and
When creating a new Item, it is initially safe to unload until a change is made by the author.
When creating a new Activity, it is initially unsafe to unload, which means the author must save the Activity or this method can be called to allow an empty Activity to be saved.