2010-11-15 08:39:52 +01:00
|
|
|
/*
|
2011-11-08 17:40:44 +01:00
|
|
|
Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved.
|
2010-11-15 08:39:52 +01:00
|
|
|
Available via Academic Free License >= 2.1 OR the modified BSD license.
|
|
|
|
see: http://dojotoolkit.org/license for details
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2011-03-04 17:02:28 +01:00
|
|
|
if(!dojo._hasResource["dojo.dnd.common"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
|
|
|
dojo._hasResource["dojo.dnd.common"] = true;
|
2010-11-15 08:39:52 +01:00
|
|
|
dojo.provide("dojo.dnd.common");
|
2011-03-04 17:02:28 +01:00
|
|
|
|
2011-11-08 17:40:44 +01:00
|
|
|
dojo.getObject("dnd", true, dojo);
|
|
|
|
|
2011-03-04 17:02:28 +01:00
|
|
|
dojo.dnd.getCopyKeyState = dojo.isCopyKey;
|
|
|
|
|
|
|
|
dojo.dnd._uniqueId = 0;
|
|
|
|
dojo.dnd.getUniqueId = function(){
|
|
|
|
// summary:
|
|
|
|
// returns a unique string for use with any DOM element
|
|
|
|
var id;
|
|
|
|
do{
|
|
|
|
id = dojo._scopeName + "Unique" + (++dojo.dnd._uniqueId);
|
|
|
|
}while(dojo.byId(id));
|
|
|
|
return id;
|
2010-11-15 08:39:52 +01:00
|
|
|
};
|
2011-03-04 17:02:28 +01:00
|
|
|
|
|
|
|
dojo.dnd._empty = {};
|
|
|
|
|
|
|
|
dojo.dnd.isFormElement = function(/*Event*/ e){
|
|
|
|
// summary:
|
|
|
|
// returns true if user clicked on a form element
|
|
|
|
var t = e.target;
|
|
|
|
if(t.nodeType == 3 /*TEXT_NODE*/){
|
|
|
|
t = t.parentNode;
|
|
|
|
}
|
|
|
|
return " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0; // Boolean
|
2010-11-15 08:39:52 +01:00
|
|
|
};
|
2011-03-04 17:02:28 +01:00
|
|
|
|
2010-11-15 08:39:52 +01:00
|
|
|
}
|