diff --git a/lib/OpenLayers/Handler/Drag.js b/lib/OpenLayers/Handler/Drag.js index 4bc98f6635..c7dd50318b 100644 --- a/lib/OpenLayers/Handler/Drag.js +++ b/lib/OpenLayers/Handler/Drag.js @@ -76,11 +76,9 @@ OpenLayers.Handler.Drag.prototype = OpenLayers.Class.inherit( OpenLayers.Handler if (this.started) { this.dragging = true; this.callback("move", [evt.xy]); - if(document.onselectstart) { - if(!this.oldOnselectstart) { - this.oldOnselectstart = document.onselectstart; - document.onselectstart = function() {return false;} - } + if(!this.oldOnselectstart) { + this.oldOnselectstart = document.onselectstart; + document.onselectstart = function() {return false;} } } return true; @@ -99,9 +97,7 @@ OpenLayers.Handler.Drag.prototype = OpenLayers.Class.inherit( OpenLayers.Handler // TBD replace with CSS classes this.map.div.style.cursor = "default"; this.callback("up", [evt.xy]); - if(document.onselectstart) { - document.onselectstart = this.oldOnselectstart; - } + document.onselectstart = this.oldOnselectstart; } return true; },