Widget close event
When user closes widget (select 'Close' button in top right corner of the widget) it should be possible to detect this event programmatically.
In addition, the same principle should be applied on the rest of the widget manipulation options (e.g. minimize, maximize, full dragboard, exit full dragboard, extract from grid, snap to grid, rename).
Seems a great idea :+1: . Probably we need to provide a generic API for registering event listeners.
In the mean time, you can detect when a widget has been unloaded (its not the same than detecting when a widget has been close, but can be useful in some situations) by using the beforeunload event:
window.addEventListener("beforeunload", ...)
And you can also detect when a widget has been renamed:
MashupPlatform.widget.context.registerCallback(function (new_values) {
if ('title' in new_values) {
// new_values.title contains the new name of the widget
}
});