Allowing users to better customize cursors for controls. Thanks to bartvde for the original patch and inspiration to get it done. Thanks ahocevar for the IE fix. r=ahocevar (closes #1484)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9258 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -162,6 +162,9 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.feature = null;
|
||||
this.dragging = false;
|
||||
this.lastPixel = null;
|
||||
OpenLayers.Element.removeClass(
|
||||
this.map.viewPortDiv, this.displayClass + "Over"
|
||||
);
|
||||
return OpenLayers.Control.prototype.deactivate.apply(this, arguments);
|
||||
},
|
||||
|
||||
@@ -178,8 +181,7 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
this.feature = feature;
|
||||
this.handlers.drag.activate();
|
||||
this.over = true;
|
||||
// TBD replace with CSS classes
|
||||
this.map.div.style.cursor = "move";
|
||||
OpenLayers.Element.addClass(this.map.viewPortDiv, this.displayClass + "Over");
|
||||
} else {
|
||||
if(this.feature.id == feature.id) {
|
||||
this.over = true;
|
||||
@@ -228,12 +230,6 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
upFeature: function(pixel) {
|
||||
if(!this.over) {
|
||||
this.handlers.drag.deactivate();
|
||||
// TBD replace with CSS classes
|
||||
this.map.div.style.cursor = "default";
|
||||
} else {
|
||||
// the drag handler itself resetted the cursor, so
|
||||
// set it back to "move" here
|
||||
this.map.div.style.cursor = "move";
|
||||
}
|
||||
},
|
||||
|
||||
@@ -260,8 +256,9 @@ OpenLayers.Control.DragFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
if(!this.handlers.drag.dragging) {
|
||||
this.over = false;
|
||||
this.handlers.drag.deactivate();
|
||||
// TBD replace with CSS classes
|
||||
this.map.div.style.cursor = "default";
|
||||
OpenLayers.Element.removeClass(
|
||||
this.map.viewPortDiv, this.displayClass + "Over"
|
||||
);
|
||||
this.feature = null;
|
||||
} else {
|
||||
if(this.feature.id == feature.id) {
|
||||
|
||||
Reference in New Issue
Block a user