Last change
on this file since 263 was
256,
checked in by hendrikvanantwerpen, 13 years ago
|
Reworked project structure based on REST interaction and Dojo library. As
soon as this is stable, the old jQueryUI branch can be removed (it's
kept for reference).
|
File size:
768 bytes
|
Line | |
---|
1 | define(["../main"], function(dojo) { |
---|
2 | // module: |
---|
3 | // dojo/dnd/common |
---|
4 | // summary: |
---|
5 | // TODOC |
---|
6 | |
---|
7 | dojo.getObject("dnd", true, dojo); |
---|
8 | |
---|
9 | dojo.dnd.getCopyKeyState = dojo.isCopyKey; |
---|
10 | |
---|
11 | dojo.dnd._uniqueId = 0; |
---|
12 | dojo.dnd.getUniqueId = function(){ |
---|
13 | // summary: |
---|
14 | // returns a unique string for use with any DOM element |
---|
15 | var id; |
---|
16 | do{ |
---|
17 | id = dojo._scopeName + "Unique" + (++dojo.dnd._uniqueId); |
---|
18 | }while(dojo.byId(id)); |
---|
19 | return id; |
---|
20 | }; |
---|
21 | |
---|
22 | dojo.dnd._empty = {}; |
---|
23 | |
---|
24 | dojo.dnd.isFormElement = function(/*Event*/ e){ |
---|
25 | // summary: |
---|
26 | // returns true if user clicked on a form element |
---|
27 | var t = e.target; |
---|
28 | if(t.nodeType == 3 /*TEXT_NODE*/){ |
---|
29 | t = t.parentNode; |
---|
30 | } |
---|
31 | return " button textarea input select option ".indexOf(" " + t.tagName.toLowerCase() + " ") >= 0; // Boolean |
---|
32 | }; |
---|
33 | |
---|
34 | return dojo.dnd; |
---|
35 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.