From 050a87e1083fb7157a15e3e2817dcaca44d77150 Mon Sep 17 00:00:00 2001 From: YUKI Hiroshi Date: Mon, 2 Nov 2015 16:01:35 +0900 Subject: [PATCH] Dispatch custom event to notify other addons that the tab bar is rendered by TST. This event is required to fix the issue #938 with Unified Sidebar. --- modules/browser.js | 4 ++++ modules/constants.js | 1 + 2 files changed, 5 insertions(+) diff --git a/modules/browser.js b/modules/browser.js index 8efd51cc..8e7de013 100644 --- a/modules/browser.js +++ b/modules/browser.js @@ -2086,6 +2086,10 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, { else this.positionPinnedTabsWithDelay(null, null, aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE); + var event = d.createEvent('Events'); + event.initEvent(this.kEVENT_TYPE_TABBAR_RENDERED, true, false); + this.mTabBrowser.tabContainer.dispatchEvent(event); + if (!collapsed && aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE) setTimeout((function() { if (this.browser) // ignore calling after destroyed... diff --git a/modules/constants.js b/modules/constants.js index da2f795b..a3578ce7 100644 --- a/modules/constants.js +++ b/modules/constants.js @@ -131,6 +131,7 @@ var TreeStyleTabConstants = Object.freeze({ kEVENT_TYPE_TABBAR_POSITION_CHANGED : 'nsDOMTreeStyleTabTabbarPositionChanged', kEVENT_TYPE_TABBAR_STATE_CHANGING : 'nsDOMTreeStyleTabTabbarStateChanging', kEVENT_TYPE_TABBAR_STATE_CHANGED : 'nsDOMTreeStyleTabTabbarStateChanged', + kEVENT_TYPE_TABBAR_RENDERED : 'nsDOMTreeStyleTabTabbarRendered', kEVENT_TYPE_FOCUS_NEXT_TAB : 'nsDOMTreeStyleTabFocusNextTab', kEVENT_TYPE_ATTACHED : 'nsDOMTreeStyleTabAttached', kEVENT_TYPE_DETACHED : 'nsDOMTreeStyleTabParted',