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

Commit e129aa6

Browse files
committed
Fix style round-tripping for archetypes with embedded styles.
1 parent b9efea2 commit e129aa6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

x-designable.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,8 @@
3636
// state
3737
selectedChanged: function(old) {
3838
this.classFollows(this.selected, old, 'selected-element');
39-
if (old) {
40-
//this.syncStyle(old);
41-
}
4239
if (this.selected) {
4340
this.ruleForElement(this.selected);
44-
//this.syncStyle(this.selected);
4541
}
4642
this.notify();
4743
},
@@ -130,7 +126,6 @@
130126
if (!sameParent && this.selected === element) {
131127
this.notify();
132128
}
133-
//this.syncStyle(element);
134129
this.selected = element;
135130
return true;
136131
}
@@ -146,9 +141,14 @@
146141
if (element.parentNode !== this) {
147142
s.left = s.top = s.position = '';
148143
}
144+
var self = this;
145+
function decorate(element) {
146+
self.applyUniqueId(element);
147+
self.ruleForElement(element);
148+
}
149149
Array.prototype.filter.call(element.children, function(c) {
150150
return ['style'].indexOf(c.localName) < 0;
151-
}).forEach(this.applyUniqueId.bind(this));
151+
}).forEach(decorate);
152152
},
153153
// stuffs required for making binding to work, ad-hoc
154154
applyUniqueId: function(node) {

0 commit comments

Comments
 (0)