From 2a8f6fbd20ac526469d799db415f06b9940d3ecc Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Fri, 28 Jan 2011 16:48:42 +0000 Subject: [PATCH] Fixed bug where eyedropper would be incorrectly disabled at times git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1945 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/extensions/ext-eyedropper.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/editor/extensions/ext-eyedropper.js b/editor/extensions/ext-eyedropper.js index 2dd451ba..ed694191 100644 --- a/editor/extensions/ext-eyedropper.js +++ b/editor/extensions/ext-eyedropper.js @@ -17,8 +17,9 @@ svgEditor.addExtension("eyedropper", function(S) { var svgcontent = S.svgcontent, svgns = "http://www.w3.org/2000/svg", svgdoc = S.svgroot.parentNode.ownerDocument, + svgCanvas = svgEditor.canvas, ChangeElementCommand = svgedit.history.ChangeElementCommand, - addToHistory = function(cmd) { canvas.undoMgr.addCommandToHistory(cmd); }, + addToHistory = function(cmd) { svgCanvas.undoMgr.addCommandToHistory(cmd); }, currentStyle = {fillPaint: "red", fillOpacity: 1.0, strokePaint: "black", strokeOpacity: 1.0, strokeWidth: 5, strokeDashArray: null, @@ -35,7 +36,7 @@ svgEditor.addExtension("eyedropper", function(S) { var elem = null; var tool = $('#tool_eyedropper'); // enable-eye-dropper if one element is selected - if (opts.elems.length == 1 && opts.elems[0] && + if (!opts.multiselected && opts.elems[0] && $.inArray(opts.elems[0].nodeName, ['svg', 'g', 'use']) == -1) { elem = opts.elems[0];