source: Dev/trunk/src/client/dojo/dnd/common.js @ 529

Last change on this file since 529 was 483, checked in by hendrikvanantwerpen, 11 years ago

Added Dojo 1.9.3 release.

File size: 979 bytes
Line 
1define(["../sniff", "../_base/kernel", "../_base/lang", "../dom"],
2        function(has, kernel, lang, dom){
3
4// module:
5//              dojo/dnd/common
6
7var exports = lang.getObject("dojo.dnd", true);
8/*=====
9// TODO: for 2.0, replace line above with this code.
10var exports = {
11        // summary:
12        //              TODOC
13};
14=====*/
15
16exports.getCopyKeyState = function(evt){
17        return evt[has("mac") ? "metaKey" : "ctrlKey"]
18};
19
20exports._uniqueId = 0;
21exports.getUniqueId = function(){
22        // summary:
23        //              returns a unique string for use with any DOM element
24        var id;
25        do{
26                id = kernel._scopeName + "Unique" + (++exports._uniqueId);
27        }while(dom.byId(id));
28        return id;
29};
30
31exports._empty = {};
32
33exports.isFormElement = function(/*Event*/ e){
34        // summary:
35        //              returns true if user clicked on a form element
36        var t = e.target;
37        if(t.nodeType == 3 /*TEXT_NODE*/){
38                t = t.parentNode;
39        }
40        return " a button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0;     // Boolean
41};
42
43return exports;
44});
Note: See TracBrowser for help on using the repository browser.