isCopyAction()

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@6579 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2010-04-07 02:13:58 +00:00
parent fcd691abc9
commit e6e0529367
3 changed files with 8 additions and 3 deletions

View File

@ -2928,8 +2928,7 @@ TreeStyleTabBrowser.prototype = {
info.canDrop = true;
info.source = tab;
if (tab) {
var isCopy = this.isAccelKeyPressed(aEvent) ||
(aEvent.dataTransfer && aEvent.dataTransfer.dropEffect == 'copy');
var isCopy = this.isCopyAction(aEvent);
if (isCopy && 'duplicateTab' in this.mTabBrowser) {
info.action |= this.kACTION_DUPLICATE;
}

View File

@ -183,7 +183,7 @@ TreeStyleTabBrowserTabbarDNDObserver.prototype = {
if (dropAction.action & this.kACTION_NEWTAB) {
dt.effectAllowed = dt.dropEffect = (
!dropAction.source ? 'link' :
sv.isAccelKeyPressed(aEvent) ? 'copy' :
sv.isCopyAction(aEvent) ? 'copy' :
'move'
);
}

View File

@ -451,6 +451,12 @@ var TreeStyleTabUtils = {
(aEvent.ctrlKey || (aEvent.keyCode == Ci.nsIDOMKeyEvent.DOM_VK_CONTROL)) ;
},
isCopyAction : function TSTUtils_isCopyAction(aEvent)
{
return this.isAccelKeyPressed(aEvent) ||
(aEvent.dataTransfer && aEvent.dataTransfer.dropEffect == 'copy');
},
isEventFiredOnClosebox : function TSTUtils_isEventFiredOnClosebox(aEvent)
{
return this.evaluateXPath(