define event types as constant properties

This commit is contained in:
SHIMODA Hiroshi 2010-12-01 09:36:22 +09:00
parent 23326d9ab3
commit 98e5745217
2 changed files with 4 additions and 2 deletions

View File

@ -621,7 +621,7 @@ TreeStyleTabBrowserAutoHide.prototype = {
{ {
/* PUBLIC API */ /* PUBLIC API */
var event = document.createEvent('Events'); 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.shown = this.expanded;
event.state = this.state; event.state = this.state;
this.mOwner.browser.dispatchEvent(event); this.mOwner.browser.dispatchEvent(event);
@ -631,7 +631,7 @@ TreeStyleTabBrowserAutoHide.prototype = {
{ {
/* PUBLIC API */ /* PUBLIC API */
var event = document.createEvent('Events'); 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.shown = this.expanded;
event.state = this.state; event.state = this.state;
event.xOffset = this.XOffset; event.xOffset = this.XOffset;

View File

@ -119,6 +119,8 @@ var TreeStyleTabUtils = {
kEVENT_TYPE_FOCUS_NEXT_TAB : 'TreeStyleTabFocusNextTab', kEVENT_TYPE_FOCUS_NEXT_TAB : 'TreeStyleTabFocusNextTab',
kEVENT_TYPE_PRINT_PREVIEW_ENTERED : 'TreeStyleTabPrintPreviewEntered', kEVENT_TYPE_PRINT_PREVIEW_ENTERED : 'TreeStyleTabPrintPreviewEntered',
kEVENT_TYPE_PRINT_PREVIEW_EXITED : 'TreeStyleTabPrintPreviewExited', 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_INDENT_MODIFIED : 'TreeStyleTab:indentModified',
kTOPIC_COLLAPSE_EXPAND_ALL : 'TreeStyleTab:collapseExpandAllSubtree', kTOPIC_COLLAPSE_EXPAND_ALL : 'TreeStyleTab:collapseExpandAllSubtree',