diff --git a/editor/svg-editor.css b/editor/svg-editor.css index 0d83f95d..b0e4cb38 100644 --- a/editor/svg-editor.css +++ b/editor/svg-editor.css @@ -88,7 +88,9 @@ body { #svg_editor #layerbuttons { margin: 0px; padding: 0px; - width: 110px; + padding-left: 2px; + padding-right: 2px; + width: 106px; height: 20px; border-right: 1px solid #FFFFFF; border-bottom: 1px solid #FFFFFF; @@ -97,8 +99,8 @@ body { } #svg_editor .layer_button { - width: 15px; - height: 15px; + width: 14px; + height: 14px; padding: 1px; border-left: 1px solid #FFFFFF; border-top: 1px solid #FFFFFF; diff --git a/editor/svg-editor.js b/editor/svg-editor.js index 4530d243..2bd85787 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -79,9 +79,6 @@ function svg_edit_setup() { // we tell it to skip focusing the text control if the // text element was previously in focus updateContextPanel(); - - // TODO: ensure that the current layer is selected - console.log(svgCanvas.getCurrentLayer()); }; var zoomChanged = function(window, bbox) { @@ -1133,6 +1130,11 @@ function svg_edit_setup() { var name = svgCanvas.getLayer(layer); $('#layerlist').append(""); } + // if we only have one layer, then always make sure that layer is selected + // (This is really only required upon first initialization) + if ($('#layerlist').size() == 1) { + $('#layerlist option:first').attr("selected", "selected"); + } $('#layerlist option').mouseup(function(evt){ $('#layerlist option').removeAttr("selected"); var option = $(this); diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index 2c24fad2..a1ff28b2 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -1,8 +1,7 @@ /* Issue 73 (Layers) TODO: -- do pop-up window that asks for layer name and rename layer, ensure that is undo-able -- ensure that pointer-events work properly with layers named the same +- ensure that the current_layer is ALWAYS selected - create API for SvgCanvas that allows the client to: - change layer order - create a mouseover region on the sidepanels that is resizable and affects all children within