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

Commit 4f5d66b

Browse files
committed
Merge pull request #5 from Polymer/master
6/17 master -> stable
2 parents 7c5b798 + 71638f7 commit 4f5d66b

17 files changed

Lines changed: 58 additions & 19 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<script src="../../web-animations-js/web-animations.js"></script>

polymer-layout/polymer-flex-layout.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
flex-direction: column;
2323
}
2424

25-
.flex, [fit] {
25+
.flex, [flex], [fit] {
2626
-webkit-box-flex: 1;
2727
-ms-flex: 1;
2828
-moz-flex: 1;

polymer-layout/polymer-flex-layout.html

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,30 @@
1919

2020
Polymer.register(this, {
2121
vertical: false,
22-
ready: function() {
22+
inserted: function() {
2323
Polymer.installControllerStyles(this, element);
24-
},
25-
insertedCallback: function() {
2624
this.layoutContainer = this.parentNode.host || this.parentNode;
2725
this.layoutContainer.classList.add('flexbox');
2826
this.verticalChanged();
2927
this.alignChanged();
3028
this.justifyChanged();
3129
},
32-
toggleContainerClass: function(name, add) {
30+
switchContainerClass: function(prefix, old, name) {
3331
if (this.layoutContainer && name) {
34-
this.layoutContainer.classList.toggle(name, add);
32+
this.layoutContainer.classList.switch(
33+
prefix + old, prefix + name);
3534
}
3635
},
3736
verticalChanged: function() {
38-
this.toggleContainerClass('column', this.vertical);
37+
if (this.layoutContainer) {
38+
this.layoutContainer.classList.toggle('column', this.vertical);
39+
}
3940
},
4041
alignChanged: function(old) {
41-
this.toggleContainerClass(old && 'align-' + old, false);
42-
this.toggleContainerClass(this.align && 'align-' + this.align, true);
42+
this.switchContainerClass('align-', old, this.align);
4343
},
4444
justifyChanged: function(old) {
45-
this.toggleContainerClass(old && 'justify-' + old, false);
46-
this.toggleContainerClass(this.justify && 'justify-' + this.justify, true);
45+
this.switchContainerClass('justify-', old, this.justify);
4746
}
4847
});
4948
</script>

polymer-layout/polymer-layout.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ready: function() {
2020
this.setAttribute('nolayout', '');
2121
},
22-
insertedCallback: function() {
22+
inserted: function() {
2323
this.asyncMethod(function() {
2424
this.prepare();
2525
this.layout();

polymer-layout/polymer-slide.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
ready: function() {
2424
this.setAttribute('nolayout', '');
2525
},
26-
insertedCallback: function() {
26+
inserted: function() {
2727
this.target = this.parentNode;
2828
},
2929
targetIdChanged: function() {

polymer-meta/polymer-meta.html

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<!--
2+
Copyright 2013 The Polymer Authors. All rights reserved.
3+
Use of this source code is governed by a BSD-style
4+
license that can be found in the LICENSE file.
5+
-->
6+
<element name="polymer-meta" attributes="list label">
7+
<script>
8+
var metaData = {}, metaArray = [];
9+
Polymer.register(this, {
10+
ready: function() {
11+
this.idChanged();
12+
},
13+
idChanged: function(old) {
14+
if (this.id && this.id !== 'meta') {
15+
this.unregister(this, old);
16+
metaData[this.id] = this;
17+
metaArray.push(this);
18+
}
19+
},
20+
unregister: function(meta, id) {
21+
delete metaData[id || meta.id];
22+
var i = metaArray.indexOf(meta);
23+
if (i >= 0) {
24+
metaArray.splice(i, 1);
25+
}
26+
},
27+
get list() {
28+
return metaArray;
29+
},
30+
get archetype() {
31+
return this.querySelector('template');
32+
},
33+
byId: function(id) {
34+
return metaData[id];
35+
}
36+
});
37+
</script>
38+
</element>

polymer-page/polymer-page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<script>
88
Polymer.register(this, {
99
fullbleed: true,
10-
insertedCallback: function() {
10+
inserted: function() {
1111
document.head.style.cssText += 'height: 100%; overflow: hidden; margin: 0;';
1212
document.body.style.cssText += 'position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; margin: 0;';
1313
document.body.style.transition = 'all 0.3s';

0 commit comments

Comments
 (0)