summaryrefslogtreecommitdiff
path: root/frontend/beta/js/YUI-extensions/dd/DropTarget.js
blob: 30e59cd8825af20530e955b61abbab5c34732c8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// kill drag drop dependency
if(YAHOO.util.DragDrop){

YAHOO.ext.dd.DropTarget = function(el, config){
    this.el = getEl(el);
    
    YAHOO.ext.util.Config.apply(this, config);
    
    if(this.containerScroll){
        YAHOO.ext.dd.ScrollManager.register(this.el);
    }
    
    YAHOO.ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, 
          {isTarget: true});

};

YAHOO.extendX(YAHOO.ext.dd.DropTarget, YAHOO.util.DDTarget, {
    isTarget : true,
    isNotifyTarget : true,
    dropAllowed : 'ydd-drop-ok',
    dropNotAllowed : 'ydd-drop-nodrop',
    
    notifyEnter : function(dd, e, data){
        if(this.overClass){
            this.el.addClass(this.overClass);
        }
        return this.dropAllowed;
    },
    
    notifyOver : function(dd, e, data){
        return this.dropAllowed;
    },
    
    notifyOut : function(dd, e, data){
        if(this.overClass){
            this.el.removeClass(this.overClass);
        }
    },
    
    notifyDrop : function(dd, e, data){
        return false;
    }
});
}