Rev | Line | |
---|
[483] | 1 | define(["../sniff", "../_base/kernel", "../_base/lang", "../dom"], |
---|
| 2 | function(has, kernel, lang, dom){ |
---|
| 3 | |
---|
| 4 | // module: |
---|
| 5 | // dojo/dnd/common |
---|
| 6 | |
---|
| 7 | var exports = lang.getObject("dojo.dnd", true); |
---|
| 8 | /*===== |
---|
| 9 | // TODO: for 2.0, replace line above with this code. |
---|
| 10 | var exports = { |
---|
| 11 | // summary: |
---|
| 12 | // TODOC |
---|
| 13 | }; |
---|
| 14 | =====*/ |
---|
| 15 | |
---|
| 16 | exports.getCopyKeyState = function(evt){ |
---|
| 17 | return evt[has("mac") ? "metaKey" : "ctrlKey"] |
---|
| 18 | }; |
---|
| 19 | |
---|
| 20 | exports._uniqueId = 0; |
---|
| 21 | exports.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 | |
---|
| 31 | exports._empty = {}; |
---|
| 32 | |
---|
| 33 | exports.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 | |
---|
| 43 | return exports; |
---|
| 44 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.