From: Dan Vanderkam Date: Sun, 29 Mar 2015 22:11:38 +0000 (-0400) Subject: Remove some IE code X-Git-Tag: v2.0.0~64^2~3 X-Git-Url: https://adrianiainlam.tk/git/?a=commitdiff_plain;h=920e93f20571f5961b7b6adcdba18ff541c92756;p=dygraphs.git Remove some IE code --- diff --git a/src/dygraph-utils.js b/src/dygraph-utils.js index eb08fef..4fa42d1 100644 --- a/src/dygraph-utils.js +++ b/src/dygraph-utils.js @@ -197,10 +197,6 @@ Dygraph.findPos = function(obj) { } copyObj = copyObj.offsetParent; } - } else { - // TODO(danvk): why would obj ever have these properties? - if (obj.x) curleft += obj.x; - if (obj.y) curtop += obj.y; } // This handles the case where the object is inside a scrolled div. @@ -221,15 +217,7 @@ Dygraph.findPos = function(obj) { * @private */ Dygraph.pageX = function(e) { - if (e.pageX) { - return (!e.pageX || e.pageX < 0) ? 0 : e.pageX; - } else { - var de = document.documentElement; - var b = document.body; - return e.clientX + - (de.scrollLeft || b.scrollLeft) - - (de.clientLeft || 0); - } + return (!e.pageX || e.pageX < 0) ? 0 : e.pageX; }; /** @@ -241,15 +229,7 @@ Dygraph.pageX = function(e) { * @private */ Dygraph.pageY = function(e) { - if (e.pageY) { - return (!e.pageY || e.pageY < 0) ? 0 : e.pageY; - } else { - var de = document.documentElement; - var b = document.body; - return e.clientY + - (de.scrollTop || b.scrollTop) - - (de.clientTop || 0); - } + return (!e.pageY || e.pageY < 0) ? 0 : e.pageY; }; /** diff --git a/src/plugins/range-selector.js b/src/plugins/range-selector.js index 4c1e938..d062382 100644 --- a/src/plugins/range-selector.js +++ b/src/plugins/range-selector.js @@ -16,7 +16,6 @@ Dygraph.Plugins.RangeSelector = (function() { "use strict"; var rangeSelector = function() { - this.isIE_ = /MSIE/.test(navigator.userAgent) && !window.opera; this.hasTouchInterface_ = typeof(TouchEvent) != 'undefined'; this.isMobileDevice_ = /mobile|android/gi.test(navigator.appVersion); this.interfaceCreated_ = false; @@ -222,22 +221,15 @@ rangeSelector.prototype.createZoomHandles_ = function() { img.style.zIndex = 10; img.style.visibility = 'hidden'; // Initially hidden so they don't show up in the wrong place. img.style.cursor = 'col-resize'; -//TODO: change image to more options - if (/MSIE 7/.test(navigator.userAgent)) { // IE7 doesn't support embedded src data. - img.width = 7; - img.height = 14; - img.style.backgroundColor = 'white'; - img.style.border = '1px solid #333333'; // Just show box in IE7. - } else { - img.width = 9; - img.height = 16; - img.src = 'data:image/png;base64,' + + // TODO: change image to more options + img.width = 9; + img.height = 16; + img.src = 'data:image/png;base64,' + 'iVBORw0KGgoAAAANSUhEUgAAAAkAAAAQCAYAAADESFVDAAAAAXNSR0IArs4c6QAAAAZiS0dEANAA' + 'zwDP4Z7KegAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAAd0SU1FB9sHGw0cMqdt1UwAAAAZdEVYdENv' + 'bW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAaElEQVQoz+3SsRFAQBCF4Z9WJM8KCDVwownl' + '6YXsTmCUsyKGkZzcl7zkz3YLkypgAnreFmDEpHkIwVOMfpdi9CEEN2nGpFdwD03yEqDtOgCaun7s' + 'qSTDH32I1pQA2Pb9sZecAxc5r3IAb21d6878xsAAAAAASUVORK5CYII='; - } if (this.isMobileDevice_) { img.width *= 2;