diff --git a/editor/svg-editor.js b/editor/svg-editor.js index d1143a16..7247adce 100644 --- a/editor/svg-editor.js +++ b/editor/svg-editor.js @@ -249,7 +249,7 @@ function svg_edit_setup() { $('#text').focus( function(){ textBeingEntered = true; } ); $('#text').blur( function(){ textBeingEntered = false; } ); - $('#image_url').blur(function(){ svgCanvas.setImageURL(this.value); }); + // bind the selected event to our function that handles updates to the UI svgCanvas.bind("selected", selectedChanged); @@ -306,6 +306,9 @@ function svg_edit_setup() { svgCanvas.setTextContent(this.value); }); + $('#image_url').keyup(function(){ + svgCanvas.setImageURL(this.value); + }); $('.attr_changer').change(function() { var attr = this.getAttribute("alt"); diff --git a/editor/svgcanvas.js b/editor/svgcanvas.js index a635183f..8d6dec0b 100644 --- a/editor/svgcanvas.js +++ b/editor/svgcanvas.js @@ -2839,7 +2839,7 @@ function BatchCommand(text) { elem = canvas.quickClone(elem); } else if (attr == "#href") { var xlinkNS="http://www.w3.org/1999/xlink"; - elem.setAttributeNS(xlinkNS, "href", val); + elem.setAttributeNS(xlinkNS, "href", newValue); } else elem.setAttribute(attr, newValue); selectedBBoxes[i] = this.getBBox(elem);