getPreventDefault() のハックは不要だった
git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@5987 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
parent
7d9dabb2a8
commit
a87a1f0ca9
@ -1310,9 +1310,7 @@ catch(e) {
|
|||||||
event.initEvent('TreeStyleTabSubtreeClosing', true, true);
|
event.initEvent('TreeStyleTabSubtreeClosing', true, true);
|
||||||
event.parent = aParentTab;
|
event.parent = aParentTab;
|
||||||
event.tabs = aClosedTabs;
|
event.tabs = aClosedTabs;
|
||||||
this.ensureEventCancelable(event);
|
return this.getTabBrowserFromChild(aParentTab).dispatchEvent(event);
|
||||||
this.getTabBrowserFromChild(aParentTab).dispatchEvent(event);
|
|
||||||
return !event.getPreventDefault();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
fireTabSubtreeClosedEvent : function TSTService_fireTabSubtreeClosedEvent(aTabBrowser, aParentTab, aClosedTabs)
|
fireTabSubtreeClosedEvent : function TSTService_fireTabSubtreeClosedEvent(aTabBrowser, aParentTab, aClosedTabs)
|
||||||
|
@ -412,22 +412,6 @@ var TreeStyleTabUtils = {
|
|||||||
|
|
||||||
// event
|
// event
|
||||||
|
|
||||||
ensureEventCancelable : function(aEvent)
|
|
||||||
{
|
|
||||||
if (aEvent.getPreventDefault) return;
|
|
||||||
// getPreventDefault is available on any event on Gecko 1.9.2 or later.
|
|
||||||
// on Gecko 1.9.1 or before, UIEvents only have the method...
|
|
||||||
aEvent.__original__preventDefault = aEvent.preventDefault;
|
|
||||||
aEvent.__canceled = false;
|
|
||||||
aEvent.preventDefault = function() {
|
|
||||||
this.__original__preventDefault();
|
|
||||||
this.__canceled = true;
|
|
||||||
};
|
|
||||||
aEvent.getPreventDefault = function() {
|
|
||||||
return this.__canceled;
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
isNewTabAction : function TSTUtils_isNewTabAction(aEvent)
|
isNewTabAction : function TSTUtils_isNewTabAction(aEvent)
|
||||||
{
|
{
|
||||||
return aEvent.button == 1 || (aEvent.button == 0 && this.isAccelKeyPressed(aEvent));
|
return aEvent.button == 1 || (aEvent.button == 0 && this.isAccelKeyPressed(aEvent));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user