Fixed issue 354: SHIFT-click or CTRL-click on an image opens image in new browser window
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1007 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -2236,6 +2236,7 @@ function BatchCommand(text) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
newImage.setAttributeNS(xlinkns, "href", last_good_img_url);
|
newImage.setAttributeNS(xlinkns, "href", last_good_img_url);
|
||||||
|
preventClickDefault(newImage);
|
||||||
break;
|
break;
|
||||||
case "square":
|
case "square":
|
||||||
// FIXME: once we create the rect, we lose information that this was a square
|
// FIXME: once we create the rect, we lose information that this was a square
|
||||||
@@ -3644,8 +3645,10 @@ function BatchCommand(text) {
|
|||||||
}
|
}
|
||||||
} // if it was a path
|
} // if it was a path
|
||||||
// else, if it was selected and this is a shift-click, remove it from selection
|
// else, if it was selected and this is a shift-click, remove it from selection
|
||||||
else if (evt.shiftKey && tempJustSelected != t) {
|
else if (evt.shiftKey) {
|
||||||
canvas.removeFromSelection([t]);
|
if(tempJustSelected != t) {
|
||||||
|
canvas.removeFromSelection([t]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} // no change in mouse position
|
} // no change in mouse position
|
||||||
}
|
}
|
||||||
@@ -4119,6 +4122,7 @@ function BatchCommand(text) {
|
|||||||
// change image href vals if possible
|
// change image href vals if possible
|
||||||
$(svgcontent).find('image').each(function() {
|
$(svgcontent).find('image').each(function() {
|
||||||
var image = this;
|
var image = this;
|
||||||
|
preventClickDefault(image);
|
||||||
var val = this.getAttributeNS(xlinkns, "href");
|
var val = this.getAttributeNS(xlinkns, "href");
|
||||||
if(val.indexOf('data:') === 0) {
|
if(val.indexOf('data:') === 0) {
|
||||||
// Check if an SVG-edit data URI
|
// Check if an SVG-edit data URI
|
||||||
@@ -5968,9 +5972,16 @@ function BatchCommand(text) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(new_el.tagName == 'image') {
|
||||||
|
preventClickDefault(new_el);
|
||||||
|
}
|
||||||
return new_el;
|
return new_el;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var preventClickDefault = function(img) {
|
||||||
|
$(img).click(function(e){e.preventDefault()});
|
||||||
|
}
|
||||||
|
|
||||||
// this creates deep DOM copies (clones) of all selected elements
|
// this creates deep DOM copies (clones) of all selected elements
|
||||||
this.cloneSelectedElements = function() {
|
this.cloneSelectedElements = function() {
|
||||||
var batchCmd = new BatchCommand("Clone Elements");
|
var batchCmd = new BatchCommand("Clone Elements");
|
||||||
|
|||||||
Reference in New Issue
Block a user