X-Git-Url: https://adrianiainlam.tk/git/?a=blobdiff_plain;f=dygraph-canvas.js;h=6bf5fbcb457e187bb089ce0b93f395e1d9d6423f;hb=bacf5ce283d6871ce1c090f29bf5411341622248;hp=03a5b4e2ca646aa6c0d96f433e7ea1a6bcf24d0b;hpb=ee60939f4e2238cbb64ebbe7acdc27195c149cfb;p=dygraphs.git diff --git a/dygraph-canvas.js b/dygraph-canvas.js index 03a5b4e..6bf5fbc 100644 --- a/dygraph-canvas.js +++ b/dygraph-canvas.js @@ -59,7 +59,7 @@ var DygraphCanvasRenderer = function(dygraph, element, elementContext, layout) { // --- check whether everything is ok before we return // NOTE(konigsberg): isIE is never defined in this object. Bug of some sort. - if (!this.isIE && !(DygraphCanvasRenderer.isSupported(this.element))) + if (!this.isIE && !(Dygraph.isCanvasSupported(this.element))) throw "Canvas is not supported."; // internal state @@ -118,30 +118,6 @@ DygraphCanvasRenderer.prototype.clear = function() { }; /** - * Checks whether the browser supports the <canvas> tag. - * @private - */ -DygraphCanvasRenderer.isSupported = function(canvasName) { - var canvas = null; - try { - if (typeof(canvasName) == 'undefined' || canvasName === null) { - canvas = document.createElement("canvas"); - } else { - canvas = canvasName; - } - canvas.getContext("2d"); - } - catch (e) { - var ie = navigator.appVersion.match(/MSIE (\d\.\d)/); - var opera = (navigator.userAgent.toLowerCase().indexOf("opera") != -1); - if ((!ie) || (ie[1] < 6) || (opera)) - return false; - return true; - } - return true; -}; - -/** * This method is responsible for drawing everything on the chart, including * lines, error bars, fills and axes. * It is called immediately after clear() on every frame, including during pans