From 03fbe4992846f24f033c59e907b86692e8e48750 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Thu, 3 Dec 2015 17:25:18 -0800 Subject: [PATCH] Hide Overview panel in Chrome. --- editor/extensions/ext-overview_window.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/editor/extensions/ext-overview_window.js b/editor/extensions/ext-overview_window.js index d391ee4a..5f2dd535 100644 --- a/editor/extensions/ext-overview_window.js +++ b/editor/extensions/ext-overview_window.js @@ -11,7 +11,13 @@ var overviewWindowGlobals = {}; svgEditor.addExtension("overview_window", function() { 'use strict'; - //define and insert the base html element + // Temporarily disabled in Chrome, see https://github.com/SVG-Edit/svgedit/issues/26 and + // https://code.google.com/p/chromium/issues/detail?id=565120. + if (svgedit.browser.isChrome()) { + return; + } + + // Define and insert the base html element. var propsWindowHtml= "\
\
\ @@ -26,7 +32,7 @@ svgEditor.addExtension("overview_window", function() { 'use strict';
"; $("#sidepanels").append(propsWindowHtml); - //define dynamic animation of the view box. + // Define dynamic animation of the view box. var updateViewBox = function(){ var portHeight=parseFloat($("#workarea").css("height")); var portWidth=parseFloat($("#workarea").css("width")); @@ -55,7 +61,7 @@ svgEditor.addExtension("overview_window", function() { 'use strict'; $("#workarea").resize(updateViewBox); updateViewBox(); - //comphensate for changes in zoom and canvas size + // Compensate for changes in zoom and canvas size. var updateViewDimensions= function(){ var viewWidth=$("#svgroot").attr("width"); var viewHeight=$("#svgroot").attr("height"); @@ -64,9 +70,9 @@ svgEditor.addExtension("overview_window", function() { 'use strict'; if(svgedit.browser.isIE()) { - //This has only been tested with Firefox 10 and IE 9 (without chrome frame). - //I am not sure if if is Firefox or IE that is being non compliant here. - //Either way the one that is noncompliant may become more compliant later. + // This has only been tested with Firefox 10 and IE 9 (without chrome frame). + // I am not sure if if is Firefox or IE that is being non compliant here. + // Either way the one that is noncompliant may become more compliant later. //TAG:HACK //TAG:VERSION_DEPENDENT //TAG:BROWSER_SNIFFING @@ -82,7 +88,7 @@ svgEditor.addExtension("overview_window", function() { 'use strict'; }; updateViewDimensions(); - //set up the overview window as a controller for the view port. + // Set up the overview window as a controller for the view port. overviewWindowGlobals.viewBoxDragging=false; var updateViewPortFromViewBox = function(){ @@ -105,7 +111,7 @@ svgEditor.addExtension("overview_window", function() { 'use strict'; ,stop :function(){overviewWindowGlobals.viewBoxDragging=false;} }); $("#overviewMiniView").click(function(evt){ - //Firefox doesn't support evt.offsetX and evt.offsetY + // Firefox doesn't support evt.offsetX and evt.offsetY. var mouseX=(evt.offsetX || evt.originalEvent.layerX); var mouseY=(evt.offsetY || evt.originalEvent.layerY); var overviewWidth =$("#overviewMiniView").attr("width" );