Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Fix style round-tripping for archetypes with embedded styles.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 1, 2014
1 parent b9efea2 commit e129aa6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions x-designable.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,8 @@
// state
selectedChanged: function(old) {
this.classFollows(this.selected, old, 'selected-element');
if (old) {
//this.syncStyle(old);
}
if (this.selected) {
this.ruleForElement(this.selected);
//this.syncStyle(this.selected);
}
this.notify();
},
Expand Down Expand Up @@ -130,7 +126,6 @@
if (!sameParent && this.selected === element) {
this.notify();
}
//this.syncStyle(element);
this.selected = element;
return true;
}
Expand All @@ -146,9 +141,14 @@
if (element.parentNode !== this) {
s.left = s.top = s.position = '';
}
var self = this;
function decorate(element) {
self.applyUniqueId(element);
self.ruleForElement(element);
}
Array.prototype.filter.call(element.children, function(c) {
return ['style'].indexOf(c.localName) < 0;
}).forEach(this.applyUniqueId.bind(this));
}).forEach(decorate);
},
// stuffs required for making binding to work, ad-hoc
applyUniqueId: function(node) {
Expand Down

0 comments on commit e129aa6

Please sign in to comment.