Fix issue 934. Patch by adambender.

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@2083 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Ahmad Syazwan
2012-05-25 04:04:22 +00:00
parent db95f77300
commit 36e0fbd2d5
3 changed files with 19 additions and 6 deletions

View File

@@ -1908,7 +1908,7 @@
$('.attr_changer').change(function() {
var attr = this.getAttribute("data-attr");
var val = this.value;
var valid = svgedit.units.isValidUnit(attr, val);
var valid = svgedit.units.isValidUnit(attr, val, selectedElement);
if(!valid) {
$.alert(uiStrings.notification.invalidAttrValGiven);
@@ -1941,6 +1941,7 @@
else {
svgCanvas.changeSelectedAttribute(attr, val);
}
this.blur();
});
// Prevent selection of elements when shift-clicking

View File

@@ -241,7 +241,7 @@ svgedit.units.convertToNum = function(attr, val) {
// Parameters:
// attr - String with the name of the attribute associated with the value
// val - String with the attribute value to check
svgedit.units.isValidUnit = function(attr, val) {
svgedit.units.isValidUnit = function(attr, val, selectedElement) {
var valid = false;
if(unit_attrs.indexOf(attr) >= 0) {
// True if it's just a number
@@ -267,7 +267,7 @@ svgedit.units.isValidUnit = function(attr, val) {
// not already present
try {
var elem = elementContainer_.getElement(val);
result = (elem == null);
result = (elem == null || elem === selectedElement);
} catch(e) {}
return result;
} else {