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:
Tim Schaub
2009-04-09 21:59:53 +00:00
parent cf81c29d31
commit 1fd32e0ff8
8 changed files with 60 additions and 32 deletions

View File

@@ -177,8 +177,9 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
this.started = true;
this.start = evt.xy;
this.last = evt.xy;
// TBD replace with CSS classes
this.map.div.style.cursor = "move";
OpenLayers.Element.addClass(
this.map.viewPortDiv, "olDragDown"
);
this.down(evt);
this.callback("down", [evt.xy]);
OpenLayers.Event.stop(evt);
@@ -247,8 +248,9 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
var dragged = (this.start != this.last);
this.started = false;
this.dragging = false;
// TBD replace with CSS classes
this.map.div.style.cursor = "";
OpenLayers.Element.removeClass(
this.map.viewPortDiv, "olDragDown"
);
this.up(evt);
this.callback("up", [evt.xy]);
if(dragged) {
@@ -274,8 +276,9 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
var dragged = (this.start != this.last);
this.started = false;
this.dragging = false;
// TBD replace with CSS classes
this.map.div.style.cursor = "";
OpenLayers.Element.removeClass(
this.map.viewPortDiv, "olDragDown"
);
this.out(evt);
this.callback("out", []);
if(dragged) {
@@ -336,6 +339,9 @@ OpenLayers.Handler.Drag = OpenLayers.Class(OpenLayers.Handler, {
this.start = null;
this.last = null;
deactivated = true;
OpenLayers.Element.removeClass(
this.map.viewPortDiv, "olDragDown"
);
}
return deactivated;
},