Issue 73: Ensure first layer is always selected. Adjust layer buttons to fit Opera and Webkit.

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@672 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2009-09-22 02:50:50 +00:00
parent ef4d16ee05
commit 61fe5dc9fe
3 changed files with 11 additions and 8 deletions

View File

@@ -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("<option value=\"" + name + "\">" + name + "</option>");
}
// 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);