From 98e57452172e1e4967473000372ecdcbe5926c36 Mon Sep 17 00:00:00 2001 From: SHIMODA Hiroshi Date: Wed, 1 Dec 2010 09:36:22 +0900 Subject: [PATCH] define event types as constant properties --- content/treestyletab/treestyletabbrowser_autoHide.js | 4 ++-- modules/utils.js | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/content/treestyletab/treestyletabbrowser_autoHide.js b/content/treestyletab/treestyletabbrowser_autoHide.js index 2d0f7010..5e1bc104 100644 --- a/content/treestyletab/treestyletabbrowser_autoHide.js +++ b/content/treestyletab/treestyletabbrowser_autoHide.js @@ -621,7 +621,7 @@ TreeStyleTabBrowserAutoHide.prototype = { { /* PUBLIC API */ var event = document.createEvent('Events'); - event.initEvent('TreeStyleTabAutoHideStateChanging', true, false); + event.initEvent(this.kEVENT_TYPE_AUTO_HIDE_STATE_CHANGING, true, false); event.shown = this.expanded; event.state = this.state; this.mOwner.browser.dispatchEvent(event); @@ -631,7 +631,7 @@ TreeStyleTabBrowserAutoHide.prototype = { { /* PUBLIC API */ var event = document.createEvent('Events'); - event.initEvent('TreeStyleTabAutoHideStateChange', true, false); + event.initEvent(this.kEVENT_TYPE_AUTO_HIDE_STATE_CHANGE, true, false); event.shown = this.expanded; event.state = this.state; event.xOffset = this.XOffset; diff --git a/modules/utils.js b/modules/utils.js index 7f9ab607..99eebe34 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -119,6 +119,8 @@ var TreeStyleTabUtils = { kEVENT_TYPE_FOCUS_NEXT_TAB : 'TreeStyleTabFocusNextTab', kEVENT_TYPE_PRINT_PREVIEW_ENTERED : 'TreeStyleTabPrintPreviewEntered', kEVENT_TYPE_PRINT_PREVIEW_EXITED : 'TreeStyleTabPrintPreviewExited', + kEVENT_TYPE_AUTO_HIDE_STATE_CHANGING : 'TreeStyleTabAutoHideStateChanging', + kEVENT_TYPE_AUTO_HIDE_STATE_CHANGE : 'TreeStyleTabAutoHideStateChange', kTOPIC_INDENT_MODIFIED : 'TreeStyleTab:indentModified', kTOPIC_COLLAPSE_EXPAND_ALL : 'TreeStyleTab:collapseExpandAllSubtree',