From 90e485283694c3921848dfa246863e6086ffd663 Mon Sep 17 00:00:00 2001 From: Piro / SHIMODA Hiroshi Date: Fri, 9 Dec 2011 02:58:36 +0900 Subject: [PATCH] confirmation message should be shown immediately, and it should not be closed by page loadings --- modules/browser.js | 6 +++--- modules/lib/confirmWithTab.js | 7 +++++-- modules/utils.js | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/modules/browser.js b/modules/browser.js index 93290b6e..82f8a4d3 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -3221,7 +3221,7 @@ TreeStyleTabBrowser.prototype = { }); } - var closeSetId = !structureRestored && this._restoreCloseSetId(aTab, mayBeDuplicated); + var closeSetId = !structureRestored && this._getCloseSetId(aTab, mayBeDuplicated); this.setTabValue(aTab, this.kID, id); this.tabsHash[id] = aTab; @@ -3295,7 +3295,7 @@ TreeStyleTabBrowser.prototype = { return [id, mayBeDuplicated]; }, - _restoreCloseSetId : function TSTBrowser_restoreCloseSetId(aTab, aMayBeDuplicated) + _getCloseSetId : function TSTBrowser_getCloseSetId(aTab, aMayBeDuplicated) { var closeSetId = null; if (!aMayBeDuplicated) { @@ -3560,7 +3560,7 @@ TreeStyleTabBrowser.prototype = { if (behavior & this.kUNDO_ASK) { let self = this; - aRestoredTab.addEventListener('SSTabRestored', function(aEvent) { + aRestoredTab.addEventListener('SSTabRestoring', function(aEvent) { aRestoredTab.removeEventListener(aEvent.type, arguments.callee, false); self.askUndoCloseTabSetBehavior(aRestoredTab, indexes.length) .next(function(aBehavior) { diff --git a/modules/lib/confirmWithTab.js b/modules/lib/confirmWithTab.js index a6f1f074..84c393b7 100644 --- a/modules/lib/confirmWithTab.js +++ b/modules/lib/confirmWithTab.js @@ -1,7 +1,7 @@ /** * @fileOverview Tab Related Confirmation Library for Firefox 3.5 or later * @author SHIMODA "Piro" Hiroshi - * @version 5 + * @version 7 * Basic usage: * * @example @@ -72,7 +72,7 @@ if (typeof namespace.Deferred == 'undefined') var confirmWithTab; (function() { - const currentRevision = 6; + const currentRevision = 7; var loadedRevision = 'confirmWithTab' in namespace ? namespace.confirmWithTab.revision : @@ -177,6 +177,9 @@ var confirmWithTab; notification.appendChild(container); } + if (aOptions.persistence) + notification.persistence = aOptions.persistence; + var strip = b.tabContainer || b.mTabContainer; var handleEvent = function handleEvent(aEvent) { if (aEvent.type == 'DOMNodeRemoved' && aEvent.target != notification) diff --git a/modules/utils.js b/modules/utils.js index d457e142..ed471a5b 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -684,6 +684,7 @@ var TreeStyleTabUtils = { this.treeBundle.getString('undoCloseTabSetBehavior.set'), this.treeBundle.getString('undoCloseTabSetBehavior.separate') ], + persistence : -1, // don't hide automatically by page loadings checkbox : checkbox, cancelEvents : ['TabClose', 'SSTabRestoring'] })