Skip to content

Commit

Permalink
Bugfix to ensure that the "class" attribute is properly saved when
Browse files Browse the repository at this point in the history
inserting an image for the first time.
  • Loading branch information
virgofx committed Nov 28, 2012
1 parent 920fdb4 commit f8e4916
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/commands/insertImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
var doc = composer.doc,
image = this.state(composer),
textNode,
i,
parent;

if (image) {
Expand All @@ -41,11 +40,8 @@

image = doc.createElement(NODE_NAME);

for (i in value) {
if (i === "className") {
i = "class";
}
image.setAttribute(i, value[i]);
for (var i in value) {
image.setAttribute(i === "className" ? "class" : i, value[i]);
}

composer.selection.insertNode(image);
Expand Down

0 comments on commit f8e4916

Please sign in to comment.