source: Dev/branches/rest-dojo-ui/client/dojo/dnd/common.js @ 256

Last change on this file since 256 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 
1define(["../main"], function(dojo) {
2        // module:
3        //              dojo/dnd/common
4        // summary:
5        //              TODOC
6
7dojo.getObject("dnd", true, dojo);
8
9dojo.dnd.getCopyKeyState = dojo.isCopyKey;
10
11dojo.dnd._uniqueId = 0;
12dojo.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
22dojo.dnd._empty = {};
23
24dojo.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
34return dojo.dnd;
35});
Note: See TracBrowser for help on using the repository browser.