wirecloud icon indicating copy to clipboard operation
wirecloud copied to clipboard

Widget close event

Open borisbrdaric opened this issue 10 years ago • 1 comments

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).

borisbrdaric avatar Aug 28 '15 08:08 borisbrdaric

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
        }
    });

aarranz avatar Sep 02 '15 11:09 aarranz