define event types as constant properties

This commit is contained in:
SHIMODA Hiroshi 2010-12-01 17:16:26 +09:00
parent fbdf7c81e4
commit 34cd4244c1
2 changed files with 4 additions and 2 deletions

View File

@ -4045,7 +4045,7 @@ TreeStyleTabBrowser.prototype = {
{
/* PUBLIC API */
var event = document.createEvent('Events');
event.initEvent('TreeStyleTabAttached', true, false);
event.initEvent(this.kEVENT_TYPE_ATTACHED, true, false);
event.parentTab = aParent;
aChild.dispatchEvent(event);
},
@ -4089,7 +4089,7 @@ TreeStyleTabBrowser.prototype = {
/* PUBLIC API */
var event = document.createEvent('Events');
event.initEvent('TreeStyleTabParted', true, false);
event.initEvent(this.kEVENT_TYPE_DETACHED, true, false);
event.parentTab = parentTab;
aChild.dispatchEvent(event);

View File

@ -130,6 +130,8 @@ var TreeStyleTabUtils = {
kEVENT_TYPE_TABBAR_STATE_CHANGING : 'TreeStyleTabTabbarStateChanging',
kEVENT_TYPE_TABBAR_STATE_CHANGED : 'TreeStyleTabTabbarStateChanged',
kEVENT_TYPE_FOCUS_NEXT_TAB : 'TreeStyleTabFocusNextTab',
kEVENT_TYPE_ATTACHED : 'TreeStyleTabAttached',
kEVENT_TYPE_DETACHED : 'TreeStyleTabParted',
kEVENT_TYPE_PRINT_PREVIEW_ENTERED : 'TreeStyleTabPrintPreviewEntered',
kEVENT_TYPE_PRINT_PREVIEW_EXITED : 'TreeStyleTabPrintPreviewExited',