( function ( mw, $ ) {
/**
- * @method confirmCloseWindow
- * @member mw
- *
* Prevent the closing of a window with a confirm message (the onbeforeunload event seems to
* work in most browsers.)
*
* // do whatever you wanted to do
* }
*
+ * @method confirmCloseWindow
+ * @member mw
* @param {Object} [options]
* @param {string} [options.namespace] Namespace for the event registration
* @param {string} [options.message]
*/
trigger: function () {
// use confirm to show the message to the user (if options.text() is true)
+ // eslint-disable-next-line no-alert
if ( options.test() && !confirm( message ) ) {
// the user want to keep the actual page
return false;