From 304d83f0edfc5b1ff008b7ef124bc93a66022097 Mon Sep 17 00:00:00 2001 From: Jeff Schiller Date: Sat, 13 Nov 2010 20:17:21 +0000 Subject: [PATCH] Add test for ChangeElementCommand git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1869 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/history.js | 8 +++-- test/history_test.html | 82 ++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 86 insertions(+), 4 deletions(-) diff --git a/editor/history.js b/editor/history.js index ed2788d9..c0e9d88e 100644 --- a/editor/history.js +++ b/editor/history.js @@ -272,7 +272,9 @@ svgedit.history.ChangeElementCommand.prototype.apply = function(handler) { else this.elem.setAttribute(attr, this.newValues[attr]); } else { - if (attr == "#text") this.elem.textContent = ""; + if (attr == "#text") { + this.elem.textContent = ""; + } else { this.elem.setAttribute(attr, ""); this.elem.removeAttribute(attr); @@ -318,7 +320,9 @@ svgedit.history.ChangeElementCommand.prototype.unapply = function(handler) { else this.elem.setAttribute(attr, this.oldValues[attr]); } else { - if (attr == "#text") this.elem.textContent = ""; + if (attr == "#text") { + this.elem.textContent = ""; + } else this.elem.removeAttribute(attr); } if (attr == "transform") { bChangedTransform = true; } diff --git a/test/history_test.html b/test/history_test.html index c446c2a1..f35693eb 100644 --- a/test/history_test.html +++ b/test/history_test.html @@ -3,15 +3,18 @@ -