You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
979 B
44 lines
979 B
define(["../sniff", "../_base/kernel", "../_base/lang", "../dom"], |
|
function(has, kernel, lang, dom){ |
|
|
|
// module: |
|
// dojo/dnd/common |
|
|
|
var exports = lang.getObject("dojo.dnd", true); |
|
/*===== |
|
// TODO: for 2.0, replace line above with this code. |
|
var exports = { |
|
// summary: |
|
// TODOC |
|
}; |
|
=====*/ |
|
|
|
exports.getCopyKeyState = function(evt){ |
|
return evt[has("mac") ? "metaKey" : "ctrlKey"] |
|
}; |
|
|
|
exports._uniqueId = 0; |
|
exports.getUniqueId = function(){ |
|
// summary: |
|
// returns a unique string for use with any DOM element |
|
var id; |
|
do{ |
|
id = kernel._scopeName + "Unique" + (++exports._uniqueId); |
|
}while(dom.byId(id)); |
|
return id; |
|
}; |
|
|
|
exports._empty = {}; |
|
|
|
exports.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 " a button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0; // Boolean |
|
}; |
|
|
|
return exports; |
|
});
|
|
|