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.
This commit is contained in:
YUKI Hiroshi 2015-11-02 16:01:35 +09:00
parent 809cc403c6
commit 050a87e108
2 changed files with 5 additions and 0 deletions

View File

@ -2086,6 +2086,10 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
else else
this.positionPinnedTabsWithDelay(null, null, aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE); 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) if (!collapsed && aReason & this.kTABBAR_UPDATE_BY_AUTOHIDE)
setTimeout((function() { setTimeout((function() {
if (this.browser) // ignore calling after destroyed... if (this.browser) // ignore calling after destroyed...

View File

@ -131,6 +131,7 @@ var TreeStyleTabConstants = Object.freeze({
kEVENT_TYPE_TABBAR_POSITION_CHANGED : 'nsDOMTreeStyleTabTabbarPositionChanged', kEVENT_TYPE_TABBAR_POSITION_CHANGED : 'nsDOMTreeStyleTabTabbarPositionChanged',
kEVENT_TYPE_TABBAR_STATE_CHANGING : 'nsDOMTreeStyleTabTabbarStateChanging', kEVENT_TYPE_TABBAR_STATE_CHANGING : 'nsDOMTreeStyleTabTabbarStateChanging',
kEVENT_TYPE_TABBAR_STATE_CHANGED : 'nsDOMTreeStyleTabTabbarStateChanged', kEVENT_TYPE_TABBAR_STATE_CHANGED : 'nsDOMTreeStyleTabTabbarStateChanged',
kEVENT_TYPE_TABBAR_RENDERED : 'nsDOMTreeStyleTabTabbarRendered',
kEVENT_TYPE_FOCUS_NEXT_TAB : 'nsDOMTreeStyleTabFocusNextTab', kEVENT_TYPE_FOCUS_NEXT_TAB : 'nsDOMTreeStyleTabFocusNextTab',
kEVENT_TYPE_ATTACHED : 'nsDOMTreeStyleTabAttached', kEVENT_TYPE_ATTACHED : 'nsDOMTreeStyleTabAttached',
kEVENT_TYPE_DETACHED : 'nsDOMTreeStyleTabParted', kEVENT_TYPE_DETACHED : 'nsDOMTreeStyleTabParted',