From 942aa40c9f6c384c3b8a20f9652c0ae7702c610a Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Tue, 22 Sep 2009 02:55:28 +0000 Subject: [PATCH] Ensure only one layer is selected (Issue 73) git-svn-id: http://svg-edit.googlecode.com/svn/trunk@673 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 2bd85787..3d01c5d7 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -1093,6 +1093,7 @@ function svg_edit_setup() { svgCanvas.createLayer(newName); updateContextPanel(); populateLayers(); + $('#layerlist option').removeAttr("selected"); $('#layerlist option:last').attr("selected", "selected"); }); @@ -1100,6 +1101,9 @@ function svg_edit_setup() { if (svgCanvas.deleteCurrentLayer()) { updateContextPanel(); populateLayers(); + // This matches what SvgCanvas does + // TODO: make this behavior less brittle (svg-editor should get which + // layer is selected from the canvas and then select that one in the UI) $('#layerlist option:last').attr("selected", "selected"); } });