websch/id_and_focus.diff

30 lines
916 B
Diff

Index: editor/units.js
===================================================================
--- editor/units.js (revision 2080)
+++ editor/units.js (working copy)
@@ -267,7 +267,7 @@
// not already present
try {
var elem = elementContainer_.getElement(val);
- result = (elem == null);
+ result = (elem == null || svgCanvas.getSelectedElems()[0].id == val);
} catch(e) {}
return result;
} else {
Index: editor/svg-editor.js
===================================================================
--- editor/svg-editor.js (revision 2080)
+++ editor/svg-editor.js (working copy)
@@ -1909,12 +1914,14 @@
var attr = this.getAttribute("data-attr");
var val = this.value;
var valid = svgedit.units.isValidUnit(attr, val);
-
if(!valid) {
$.alert(uiStrings.notification.invalidAttrValGiven);
this.value = selectedElement.getAttribute(attr);
return false;
}