From f349b4e91fd4206b45a0aeb8689470039d8e402c Mon Sep 17 00:00:00 2001 From: Kevin Kwok Date: Fri, 4 Sep 2009 23:13:15 +0000 Subject: [PATCH] Fixed error with setting image url git-svn-id: http://svg-edit.googlecode.com/svn/trunk@582 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/svg-editor.js | 5 ++++- editor/svgcanvas.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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);