[Commits] r2154 - in core/trunk/geoext: lib/GeoExt/widgets resources/css

commits at geoext.org commits at geoext.org
Sat May 1 22:38:21 CEST 2010


Author: ahocevar
Date: 2010-05-01 22:38:21 +0200 (Sat, 01 May 2010)
New Revision: 2154

Modified:
   core/trunk/geoext/lib/GeoExt/widgets/VectorLegend.js
   core/trunk/geoext/resources/css/geoext-all-debug.css
Log:
reverted accidently committed portions (see #275)


Modified: core/trunk/geoext/lib/GeoExt/widgets/VectorLegend.js
===================================================================
--- core/trunk/geoext/lib/GeoExt/widgets/VectorLegend.js	2010-05-01 19:34:54 UTC (rev 2153)
+++ core/trunk/geoext/lib/GeoExt/widgets/VectorLegend.js	2010-05-01 20:38:21 UTC (rev 2154)
@@ -499,53 +499,31 @@
      *  Adds drag & drop functionality to a rule entry.
      */
     addDD: function(component) {
-        var ct = component.ownerCt;
+        var cursor = component.body.getStyle("cursor");
+        var dd = new Ext.Panel.DD(component);
+        // restore previous curser (if set). because Panel.DD always
+        // sets a move cursor
+        component.body.setStyle("cursor", cursor || "move");
         var panel = this;
-        new Ext.dd.DragSource(component.getEl(), {
-            ddGroup: ct.id,
-            onDragOut: function(e, targetId) {
-                var target = Ext.getCmp(targetId);
-                target.removeClass("gx-ruledrag-insert-above");
-                target.removeClass("gx-ruledrag-insert-below");
-                return Ext.dd.DragZone.prototype.onDragOut.apply(this, arguments);
-            },
-            onDragEnter: function(e, targetId) {
-                var target = Ext.getCmp(targetId);
-                var cls;
-                var sourcePos = ct.items.indexOf(component);
-                var targetPos = ct.items.indexOf(target);
-                if (sourcePos > targetPos) {
-                    cls = "gx-ruledrag-insert-above";
-                } else if (sourcePos < targetPos) {
-                    cls = "gx-ruledrag-insert-below";
-                }                
-                cls && target.addClass(cls);
-                return Ext.dd.DragZone.prototype.onDragEnter.apply(this, arguments);
-            },
-            onDragDrop: function(e, targetId) {
-                panel.moveRule(ct.items.indexOf(component),
-                    ct.items.indexOf(Ext.getCmp(targetId)));
-                return Ext.dd.DragZone.prototype.onDragDrop.apply(this, arguments);
-            },
-            getDragData: function(e) {
-                var sourceEl = e.getTarget(".x-column-inner");
-                if(sourceEl) {
-                    var d = sourceEl.cloneNode(true);
-                    d.id = Ext.id();
-                    return {
-                        sourceEl: sourceEl,
-                        repairXY: Ext.fly(sourceEl).getXY(),
-                        ddel: d
+        var dropZone = new Ext.dd.DropTarget(component.getEl(), {
+            notifyDrop: function(ddSource) {
+                var source = Ext.getCmp(ddSource.getEl().id);
+                var target = Ext.getCmp(this.getEl().id);
+                // sometimes, for whatever reason, Ext forgets who the source
+                // was, so we make sure that we have one before moving on
+                if (source && target && source != target) {
+                    var sourceCt = source.ownerCt;
+                    var targetCt = target.ownerCt;
+                    // only move rules around inside the same container
+                    if (sourceCt == targetCt) {
+                        panel.moveRule(
+                            sourceCt.items.indexOf(source),
+                            targetCt.items.indexOf(target)
+                        );
                     }
                 }
             }
         });
-        new Ext.dd.DropTarget(component.getEl(), {
-            ddGroup: ct.id,
-            notifyDrop: function() {
-                return true;
-            }
-        });
     },
     
     /** api: method[update]

Modified: core/trunk/geoext/resources/css/geoext-all-debug.css
===================================================================
--- core/trunk/geoext/resources/css/geoext-all-debug.css	2010-05-01 19:34:54 UTC (rev 2153)
+++ core/trunk/geoext/resources/css/geoext-all-debug.css	2010-05-01 20:38:21 UTC (rev 2154)
@@ -4,4 +4,3 @@
  * overrides go into gxtheme-<theme>.css
  */
 @import "popup.css";
- at import "layerlegend.css";



More information about the Commits mailing list