Prevent the default image dragging behavior in IE < 9

This commit is contained in:
Austin Hyde
2013-11-26 14:52:11 -05:00
parent 1215f58241
commit d3b2b1cd9e
2 changed files with 15 additions and 0 deletions

View File

@@ -159,6 +159,11 @@ a.ol-full-screen-true:after {
-ms-user-select: none;
user-select: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
cursor: default;
}
.ol-viewport .ol-unselectable:not([ie8andbelow]) {
cursor: auto;
}
.ol-zoom {
position: absolute;

View File

@@ -3,7 +3,9 @@ goog.provide('ol.renderer.dom.Map');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.dom.TagName');
goog.require('goog.functions');
goog.require('goog.style');
goog.require('goog.userAgent');
goog.require('ol.css');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
@@ -36,6 +38,14 @@ ol.renderer.dom.Map = function(container, map) {
style.width = '100%';
style.height = '100%';
// in IE < 9, we need to return false from ondragstart to cancel the default
// behavior of dragging images, which is interfering with the custom handler
// in the Drag interaction subclasses
if (goog.userAgent.IE && !goog.userAgent.isVersionOrHigher('9.0')) {
this.layersPane_.ondragstart = goog.functions.FALSE;
this.layersPane_.onselectstart = goog.functions.FALSE;
}
goog.dom.insertChildAt(container, this.layersPane_, 0);
/**