Commit 57fa4ba6 authored by Eric Bidelman's avatar Eric Bidelman

Update to polymer 1.2.3

parent 7dca6f71
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"dependencies": { "dependencies": {
"todomvc-common": "^1.0.1", "todomvc-common": "^1.0.1",
"todomvc-app-css": "^1.0.0", "todomvc-app-css": "^1.0.0",
"polymer": "Polymer/polymer#^1.2.2", "polymer": "Polymer/polymer#^1.2.3",
"iron-selector": "PolymerElements/iron-selector#^1.0.5", "iron-selector": "PolymerElements/iron-selector#^1.0.5",
"flatiron-director": "PolymerLabs/flatiron-director#^1.0.0", "flatiron-director": "PolymerLabs/flatiron-director#^1.0.0",
"iron-localstorage": "PolymerElements/iron-localstorage#^1.0.4" "iron-localstorage": "PolymerElements/iron-localstorage#^1.0.4"
......
...@@ -127,30 +127,40 @@ Polymer.RenderStatus._makeReady(); ...@@ -127,30 +127,40 @@ Polymer.RenderStatus._makeReady();
_afterNextRenderQueue: [], _afterNextRenderQueue: [],
_waitingNextRender: false, _waitingNextRender: false,
afterNextRender: function (element, fn, args) { afterNextRender: function (element, fn, args) {
if (!this._waitingNextRender) { this._watchNextRender();
this._waitingNextRender = true;
this.whenReady(this._flushAfterNextRender);
}
this._afterNextRenderQueue.push([ this._afterNextRenderQueue.push([
element, element,
fn, fn,
args args
]); ]);
}, },
_flushAfterNextRender: function () { _watchNextRender: function () {
requestAnimationFrame(function () { if (!this._waitingNextRender) {
setTimeout(Polymer.RenderStatus.__flushAfterNextRender); this._waitingNextRender = true;
}); var fn = function () {
Polymer.RenderStatus._flushNextRender();
};
if (!this._ready) {
this.whenReady(fn);
} else {
requestAnimationFrame(fn);
}
}
}, },
__flushAfterNextRender: function () { _flushNextRender: function () {
var self = Polymer.RenderStatus; var self = this;
setTimeout(function () {
self._flushRenderCallbacks(self._afterNextRenderQueue);
self._afterNextRenderQueue = [];
self._waitingNextRender = false; self._waitingNextRender = false;
for (var i = 0, h; i < self._afterNextRenderQueue.length; i++) { });
h = self._afterNextRenderQueue[i]; },
_flushRenderCallbacks: function (callbacks) {
for (var i = 0, h; i < callbacks.length; i++) {
h = callbacks[i];
h[1].apply(h[0], h[2] || Polymer.nar); h[1].apply(h[0], h[2] || Polymer.nar);
} }
; ;
self._afterNextRenderQueue = [];
} }
}; };
if (window.HTMLImports) { if (window.HTMLImports) {
...@@ -284,7 +294,7 @@ import: function (id, selector) { ...@@ -284,7 +294,7 @@ import: function (id, selector) {
if (id) { if (id) {
var m = findModule(id); var m = findModule(id);
if (!m) { if (!m) {
forceDocumentUpgrade(); forceDomModulesUpgrade();
m = findModule(id); m = findModule(id);
} }
if (m && selector) { if (m && selector) {
...@@ -296,12 +306,17 @@ return m; ...@@ -296,12 +306,17 @@ return m;
}); });
var cePolyfill = window.CustomElements && !CustomElements.useNative; var cePolyfill = window.CustomElements && !CustomElements.useNative;
document.registerElement('dom-module', DomModule); document.registerElement('dom-module', DomModule);
function forceDocumentUpgrade() { function forceDomModulesUpgrade() {
if (cePolyfill) { if (cePolyfill) {
var script = document._currentScript || document.currentScript; var script = document._currentScript || document.currentScript;
var doc = script && script.ownerDocument || document; var doc = script && script.ownerDocument || document;
if (doc) { var modules = doc.querySelectorAll('dom-module');
CustomElements.upgradeAll(doc); for (var i = modules.length - 1, m; i >= 0 && (m = modules[i]); i--) {
if (m.__upgraded__) {
return;
} else {
CustomElements.upgrade(m);
}
} }
} }
} }
...@@ -661,7 +676,7 @@ debouncer.stop(); ...@@ -661,7 +676,7 @@ debouncer.stop();
} }
} }
}); });
Polymer.version = '1.2.2'; Polymer.version = '1.2.3';
Polymer.Base._addFeature({ Polymer.Base._addFeature({
_registerFeatures: function () { _registerFeatures: function () {
this._prepIs(); this._prepIs();
......
...@@ -16,9 +16,8 @@ this._template = Polymer.DomModule.import(this.is, 'template'); ...@@ -16,9 +16,8 @@ this._template = Polymer.DomModule.import(this.is, 'template');
if (this._template && this._template.hasAttribute('is')) { if (this._template && this._template.hasAttribute('is')) {
this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' + 'must not be a type-extension, found', this._template, 'Move inside simple <template>.')); this._warn(this._logf('_prepTemplate', 'top-level Polymer template ' + 'must not be a type-extension, found', this._template, 'Move inside simple <template>.'));
} }
if (this._template && !this._template.content && HTMLTemplateElement.bootstrap) { if (this._template && !this._template.content && window.HTMLTemplateElement && HTMLTemplateElement.decorate) {
HTMLTemplateElement.decorate(this._template); HTMLTemplateElement.decorate(this._template);
HTMLTemplateElement.bootstrap(this._template.content);
} }
}, },
_stampTemplate: function () { _stampTemplate: function () {
......
...@@ -3527,19 +3527,19 @@ this._appliesToDocument = true; ...@@ -3527,19 +3527,19 @@ this._appliesToDocument = true;
var e = this.__appliedElement || this; var e = this.__appliedElement || this;
styleDefaults.addStyle(e); styleDefaults.addStyle(e);
if (e.textContent || this.include) { if (e.textContent || this.include) {
this._apply(); this._apply(true);
} else { } else {
var self = this; var self = this;
var observer = new MutationObserver(function () { var observer = new MutationObserver(function () {
observer.disconnect(); observer.disconnect();
self._apply(); self._apply(true);
}); });
observer.observe(e, { childList: true }); observer.observe(e, { childList: true });
} }
} }
} }
}, },
_apply: function () { _apply: function (deferProperties) {
var e = this.__appliedElement || this; var e = this.__appliedElement || this;
if (this.include) { if (this.include) {
e.textContent = styleUtil.cssFromModules(this.include, true) + e.textContent; e.textContent = styleUtil.cssFromModules(this.include, true) + e.textContent;
...@@ -3548,7 +3548,19 @@ if (e.textContent) { ...@@ -3548,7 +3548,19 @@ if (e.textContent) {
styleUtil.forEachStyleRule(styleUtil.rulesForStyle(e), function (rule) { styleUtil.forEachStyleRule(styleUtil.rulesForStyle(e), function (rule) {
styleTransformer.documentRule(rule); styleTransformer.documentRule(rule);
}); });
this._applyCustomProperties(e); var self = this;
function fn() {
self._applyCustomProperties(e);
}
if (this._pendingApplyProperties) {
cancelAnimationFrame(this._pendingApplyProperties);
this._pendingApplyProperties = null;
}
if (deferProperties) {
this._pendingApplyProperties = requestAnimationFrame(fn);
} else {
fn();
}
} }
}, },
_applyCustomProperties: function (element) { _applyCustomProperties: function (element) {
......
...@@ -16,26 +16,26 @@ Code distributed by Google as part of the polymer project is also ...@@ -16,26 +16,26 @@ Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
--></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-localstorage" assetpath="../bower_components/iron-localstorage/"></dom-module> --></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-localstorage" assetpath="../bower_components/iron-localstorage/"></dom-module>
<dom-module id="td-model" assetpath="/"> <dom-module id="td-model" assetpath="/">
<template> <template strip-whitespace="">
<iron-localstorage name="todos-polymer" value="{{items}}" on-iron-localstorage-load-empty="_initializeDefaultTodos"></iron-localstorage> <iron-localstorage name="todos-polymer" value="{{items}}" on-iron-localstorage-load-empty="_initializeDefaultTodos"></iron-localstorage>
</template> </template>
</dom-module> </dom-module>
<dom-module id="td-item" assetpath="/"> <dom-module id="td-item" assetpath="/">
<template> <template strip-whitespace="">
<template is="dom-if" if="{{!editing}}"> <template is="dom-if" if="{{!editing}}" strip-whitespace="">
<div on-dblclick="_editAction"> <div on-dblclick="_editAction">
<input type="checkbox" class="toggle" checked="{{item.completed::change}}"> <input type="checkbox" class="toggle" checked="{{item.completed::change}}">
<label>{{item.title}}</label> <label>{{item.title}}</label>
<button class="destroy" on-tap="_destroyAction"></button> <button class="destroy" on-tap="_destroyAction"></button>
</div> </div>
</template> </template>
<template is="dom-if" if="{{editing}}"> <template is="dom-if" if="{{editing}}" strip-whitespace="">
<input is="td-input" id="edit" class="edit" value="{{_editingValue::input}}" on-td-input-commit="_commitAction" on-td-input-cancel="_cancelAction" on-blur="_onBlur"> <input is="td-input" id="edit" class="edit" value="{{_editingValue::input}}" on-td-input-commit="_commitAction" on-td-input-cancel="_cancelAction" on-blur="_onBlur">
</template> </template>
</template> </template>
</dom-module> </dom-module>
<dom-module id="td-todos" assetpath="/"> <dom-module id="td-todos" assetpath="/">
<template> <template strip-whitespace="">
<style> :host { display: block; } </style> <style> :host { display: block; } </style>
<flatiron-director route="{{route}}" hidden=""></flatiron-director> <flatiron-director route="{{route}}" hidden=""></flatiron-director>
<section id="todoapp"> <section id="todoapp">
...@@ -48,7 +48,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN ...@@ -48,7 +48,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<input id="toggle-all" type="checkbox" checked="[[allCompleted]]" on-change="toggleAllCompletedAction"> <input id="toggle-all" type="checkbox" checked="[[allCompleted]]" on-change="toggleAllCompletedAction">
<label for="toggle-all">Mark all as complete</label> <label for="toggle-all">Mark all as complete</label>
<ul id="todo-list" on-td-destroy-item="destroyItemAction"> <ul id="todo-list" on-td-destroy-item="destroyItemAction">
<template id="todo-list-repeater" is="dom-repeat" items="{{items}}" filter="{{matchesFilter(route)}}" observe="completed"> <template id="todo-list-repeater" is="dom-repeat" items="{{items}}" filter="{{matchesFilter(route)}}" observe="completed" initial-count="10" strip-whitespace="">
<li is="td-item" item="{{item}}"></li> <li is="td-item" item="{{item}}"></li>
</template> </template>
</ul> </ul>
...@@ -57,7 +57,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN ...@@ -57,7 +57,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<footer id="footer"> <footer id="footer">
<span id="todo-count"> <span id="todo-count">
<strong>{{activeCount}}</strong> <strong>{{activeCount}}</strong>
<span>{{_computeItemsLeft(activeCount)}}</span> left <span>{{_computeItemsLeft(activeCount)}}</span><span> left</span>
</span> </span>
<iron-selector id="filters" selected="{{route}}" attr-for-selected="route"> <iron-selector id="filters" selected="{{route}}" attr-for-selected="route">
...@@ -72,7 +72,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN ...@@ -72,7 +72,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
</li> </li>
</iron-selector> </iron-selector>
<template is="dom-if" if="{{anyCompleted}}"> <template is="dom-if" if="{{anyCompleted}}" strip-whitespace="">
<button id="clear-completed" on-tap="clearCompletedAction" style="visibility:visible">Clear completed</button> <button id="clear-completed" on-tap="clearCompletedAction" style="visibility:visible">Clear completed</button>
</template> </template>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
<link rel="import" href="td-input.html"> <link rel="import" href="td-input.html">
<dom-module id="td-item"> <dom-module id="td-item">
<template> <template strip-whitespace>
<template is="dom-if" if="{{!editing}}"> <template is="dom-if" if="{{!editing}}" strip-whitespace>
<div on-dblclick="_editAction"> <div on-dblclick="_editAction">
<input type="checkbox" class="toggle" <input type="checkbox" class="toggle"
checked="{{item.completed::change}}"> checked="{{item.completed::change}}">
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<button class="destroy" on-tap="_destroyAction"></button> <button class="destroy" on-tap="_destroyAction"></button>
</div> </div>
</template> </template>
<template is="dom-if" if="{{editing}}"> <template is="dom-if" if="{{editing}}" strip-whitespace>
<input is="td-input" id="edit" class="edit" <input is="td-input" id="edit" class="edit"
value="{{_editingValue::input}}" value="{{_editingValue::input}}"
on-td-input-commit="_commitAction" on-td-input-commit="_commitAction"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<link rel="import" href="../bower_components/iron-localstorage/iron-localstorage.html"> <link rel="import" href="../bower_components/iron-localstorage/iron-localstorage.html">
<dom-module id="td-model"> <dom-module id="td-model">
<template> <template strip-whitespace>
<iron-localstorage name="todos-polymer" value="{{items}}" <iron-localstorage name="todos-polymer" value="{{items}}"
on-iron-localstorage-load-empty="_initializeDefaultTodos"></iron-localstorage> on-iron-localstorage-load-empty="_initializeDefaultTodos"></iron-localstorage>
</template> </template>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<link rel="import" href="td-item.html"> <link rel="import" href="td-item.html">
<dom-module id="td-todos"> <dom-module id="td-todos">
<template> <template strip-whitespace>
<style> <style>
:host { :host {
display: block; display: block;
...@@ -27,7 +27,9 @@ ...@@ -27,7 +27,9 @@
<label for="toggle-all">Mark all as complete</label> <label for="toggle-all">Mark all as complete</label>
<ul id="todo-list" on-td-destroy-item="destroyItemAction"> <ul id="todo-list" on-td-destroy-item="destroyItemAction">
<template id="todo-list-repeater" is="dom-repeat" items="{{items}}" <template id="todo-list-repeater" is="dom-repeat" items="{{items}}"
filter="{{matchesFilter(route)}}" observe="completed"> filter="{{matchesFilter(route)}}" observe="completed"
initial-count="10"
strip-whitespace>
<li is="td-item" item="{{item}}"></li> <li is="td-item" item="{{item}}"></li>
</template> </template>
</ul> </ul>
...@@ -36,7 +38,7 @@ ...@@ -36,7 +38,7 @@
<footer id="footer"> <footer id="footer">
<span id="todo-count"> <span id="todo-count">
<strong>{{activeCount}}</strong> <strong>{{activeCount}}</strong>
<span>{{_computeItemsLeft(activeCount)}}</span> left <span>{{_computeItemsLeft(activeCount)}}</span><span> left</span>
</span> </span>
<iron-selector id="filters" selected="{{route}}" attr-for-selected="route"> <iron-selector id="filters" selected="{{route}}" attr-for-selected="route">
...@@ -51,7 +53,7 @@ ...@@ -51,7 +53,7 @@
</li> </li>
</iron-selector> </iron-selector>
<template is="dom-if" if="{{anyCompleted}}"> <template is="dom-if" if="{{anyCompleted}}" strip-whitespace>
<button id="clear-completed" on-tap="clearCompletedAction" <button id="clear-completed" on-tap="clearCompletedAction"
style="visibility:visible">Clear completed</button> style="visibility:visible">Clear completed</button>
</template> </template>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment