|
|
@@ -75,7 +75,7 @@ export default class PendingActions extends Plugin {
|
|
|
/* istanbul ignore next */
|
|
|
this._domEmitter.listenTo( window, 'beforeunload', ( evtInfo, domEvt ) => {
|
|
|
if ( this.isPending ) {
|
|
|
- domEvt.returnValue = this._actions.get( 0 ).message;
|
|
|
+ domEvt.returnValue = this.first.message;
|
|
|
}
|
|
|
} );
|
|
|
}
|
|
|
@@ -118,6 +118,15 @@ export default class PendingActions extends Plugin {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Returns first action from the list.
|
|
|
+ *
|
|
|
+ * returns {Object} Pending action object.
|
|
|
+ */
|
|
|
+ get first() {
|
|
|
+ return this._actions.get( 0 );
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Iterable interface.
|
|
|
*
|
|
|
* @returns {Iterable.<*>}
|