Add ability to set the svg drawing without adding to the undo stack.

This commit is contained in:
KB Jørgensen
2018-01-22 11:37:42 +01:00
parent 0e648e7fd8
commit 07803fd1db

View File

@@ -4442,7 +4442,7 @@ var convertToGroup = this.convertToGroup = function(elem) {
//
// Returns:
// This function returns false if the set was unsuccessful, true otherwise.
this.setSvgString = function(xmlString) {
this.setSvgString = function(xmlString, preventUndo) {
try {
// convert string into XML document
var newDoc = svgedit.utilities.text2xml(xmlString);
@@ -4596,7 +4596,7 @@ this.setSvgString = function(xmlString) {
svgedit.path.clearData();
svgroot.appendChild(selectorManager.selectorParentGroup);
addCommandToHistory(batchCmd);
if(!preventUndo) addCommandToHistory(batchCmd);
call('changed', [svgcontent]);
} catch(e) {
console.log(e);