author | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2011-10-03 16:04:12 (UTC) |
---|---|---|
committer | Giulio Cesare Solaroli <giulio.cesare@solaroli.it> | 2011-10-03 16:04:12 (UTC) |
commit | 541bb378ddece2eab135a8066a16994e94436dea (patch) (side-by-side diff) | |
tree | ff160ea3e26f7fe07fcfd401387c5a0232ca715e /frontend/beta/js/YUI-extensions/dd/DropZone.js | |
parent | 1bf431fd3d45cbdf4afa3e12afefe5d24f4d3bc7 (diff) | |
parent | ecad5e895831337216544e81f1a467e0c68c4a6a (diff) | |
download | clipperz-541bb378ddece2eab135a8066a16994e94436dea.zip clipperz-541bb378ddece2eab135a8066a16994e94436dea.tar.gz clipperz-541bb378ddece2eab135a8066a16994e94436dea.tar.bz2 |
Merge pull request #1 from gcsolaroli/master
First version of the restructured repository
Diffstat (limited to 'frontend/beta/js/YUI-extensions/dd/DropZone.js') (more/less context) (show whitespace changes)
-rw-r--r-- | frontend/beta/js/YUI-extensions/dd/DropZone.js | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/frontend/beta/js/YUI-extensions/dd/DropZone.js b/frontend/beta/js/YUI-extensions/dd/DropZone.js new file mode 100644 index 0000000..ce446fb --- a/dev/null +++ b/frontend/beta/js/YUI-extensions/dd/DropZone.js @@ -0,0 +1,81 @@ +// kill drag drop dependency
+if(YAHOO.util.DragDrop){
+YAHOO.ext.dd.DropZone = function(el, config){
+ YAHOO.ext.dd.DropZone.superclass.constructor.call(this, el, config);
+};
+
+YAHOO.extendX(YAHOO.ext.dd.DropZone, YAHOO.ext.dd.DropTarget, {
+ getTargetFromEvent : function(e){
+ return YAHOO.ext.dd.Registry.getTargetFromEvent(e);
+ },
+
+ onNodeEnter : function(n, dd, e, data){
+
+ },
+
+ onNodeOver : function(n, dd, e, data){
+ return this.dropAllowed;
+ },
+
+ onNodeOut : function(n, dd, e, data){
+
+ },
+
+ onNodeDrop : function(n, dd, e, data){
+ return false;
+ },
+
+ onContainerOver : function(n, dd, e, data){
+ return this.dropNotAllowed;
+ },
+
+ onContainerDrop : function(n, dd, e, data){
+ return false;
+ },
+
+ notifyEnter : function(dd, e, data){
+ return this.dropNotAllowed;
+ },
+
+ notifyOver : function(dd, e, data){
+ var n = this.getTargetFromEvent(e);
+ if(!n){ // not over valid drop target
+ if(this.lastOverNode){
+ this.onNodeOut(this.lastOverNode, dd, e, data);
+ this.lastOverNode = null;
+ }
+ return this.onContainerOver(dd, e, data);
+ }
+ if(this.lastOverNode != n){
+ if(this.lastOverNode){
+ this.onNodeOut(this.lastOverNode, dd, e, data);
+ }
+ this.onNodeEnter(n, dd, e, data);
+ this.lastOverNode = n;
+ }
+ return this.onNodeOver(n, dd, e, data);
+ },
+
+ notifyOut : function(dd, e, data){
+ if(this.lastOverNode){
+ this.onNodeOut(this.lastOverNode, dd, e, data);
+ this.lastOverNode = null;
+ }
+ },
+
+ notifyDrop : function(dd, e, data){
+ if(this.lastOverNode){
+ this.onNodeOut(this.lastOverNode, dd, e, data);
+ this.lastOverNode = null;
+ }
+ var n = this.getTargetFromEvent(e);
+ return n ?
+ this.onNodeDrop(n, dd, e, data) :
+ this.onContainerDrop(n, dd, e, data);
+ },
+
+ triggerCacheRefresh : function(){
+ YAHOO.util.DDM.refreshCache(this.groups);
+ }
+});
+} |