Commit b2d25b5a authored by Sam Saccone's avatar Sam Saccone

Merge pull request #1524 from ebidel/poly123

Update to polymer 1.2.3
parents 7dca6f71 57fa4ba6
......@@ -4,7 +4,7 @@
"dependencies": {
"todomvc-common": "^1.0.1",
"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",
"flatiron-director": "PolymerLabs/flatiron-director#^1.0.0",
"iron-localstorage": "PolymerElements/iron-localstorage#^1.0.4"
......
......@@ -127,30 +127,40 @@ Polymer.RenderStatus._makeReady();
_afterNextRenderQueue: [],
_waitingNextRender: false,
afterNextRender: function (element, fn, args) {
if (!this._waitingNextRender) {
this._waitingNextRender = true;
this.whenReady(this._flushAfterNextRender);
}
this._watchNextRender();
this._afterNextRenderQueue.push([
element,
fn,
args
]);
},
_flushAfterNextRender: function () {
requestAnimationFrame(function () {
setTimeout(Polymer.RenderStatus.__flushAfterNextRender);
});
_watchNextRender: function () {
if (!this._waitingNextRender) {
this._waitingNextRender = true;
var fn = function () {
Polymer.RenderStatus._flushNextRender();
};
if (!this._ready) {
this.whenReady(fn);
} else {
requestAnimationFrame(fn);
}
}
},
__flushAfterNextRender: function () {
var self = Polymer.RenderStatus;
_flushNextRender: function () {
var self = this;
setTimeout(function () {
self._flushRenderCallbacks(self._afterNextRenderQueue);
self._afterNextRenderQueue = [];
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);
}
;
self._afterNextRenderQueue = [];
}
};
if (window.HTMLImports) {
......@@ -284,7 +294,7 @@ import: function (id, selector) {
if (id) {
var m = findModule(id);
if (!m) {
forceDocumentUpgrade();
forceDomModulesUpgrade();
m = findModule(id);
}
if (m && selector) {
......@@ -296,12 +306,17 @@ return m;
});
var cePolyfill = window.CustomElements && !CustomElements.useNative;
document.registerElement('dom-module', DomModule);
function forceDocumentUpgrade() {
function forceDomModulesUpgrade() {
if (cePolyfill) {
var script = document._currentScript || document.currentScript;
var doc = script && script.ownerDocument || document;
if (doc) {
CustomElements.upgradeAll(doc);
var modules = doc.querySelectorAll('dom-module');
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();
}
}
});
Polymer.version = '1.2.2';
Polymer.version = '1.2.3';
Polymer.Base._addFeature({
_registerFeatures: function () {
this._prepIs();
......
......@@ -16,9 +16,8 @@ this._template = Polymer.DomModule.import(this.is, 'template');
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>.'));
}
if (this._template && !this._template.content && HTMLTemplateElement.bootstrap) {
if (this._template && !this._template.content && window.HTMLTemplateElement && HTMLTemplateElement.decorate) {
HTMLTemplateElement.decorate(this._template);
HTMLTemplateElement.bootstrap(this._template.content);
}
},
_stampTemplate: function () {
......
......@@ -3527,19 +3527,19 @@ this._appliesToDocument = true;
var e = this.__appliedElement || this;
styleDefaults.addStyle(e);
if (e.textContent || this.include) {
this._apply();
this._apply(true);
} else {
var self = this;
var observer = new MutationObserver(function () {
observer.disconnect();
self._apply();
self._apply(true);
});
observer.observe(e, { childList: true });
}
}
}
},
_apply: function () {
_apply: function (deferProperties) {
var e = this.__appliedElement || this;
if (this.include) {
e.textContent = styleUtil.cssFromModules(this.include, true) + e.textContent;
......@@ -3548,7 +3548,19 @@ if (e.textContent) {
styleUtil.forEachStyleRule(styleUtil.rulesForStyle(e), function (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) {
......
......@@ -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
--></head><body><div hidden="" by-vulcanize=""><dom-module id="iron-localstorage" assetpath="../bower_components/iron-localstorage/"></dom-module>
<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>
</template>
</dom-module>
<dom-module id="td-item" assetpath="/">
<template>
<template is="dom-if" if="{{!editing}}">
<template strip-whitespace="">
<template is="dom-if" if="{{!editing}}" strip-whitespace="">
<div on-dblclick="_editAction">
<input type="checkbox" class="toggle" checked="{{item.completed::change}}">
<label>{{item.title}}</label>
<button class="destroy" on-tap="_destroyAction"></button>
</div>
</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">
</template>
</template>
</dom-module>
<dom-module id="td-todos" assetpath="/">
<template>
<template strip-whitespace="">
<style> :host { display: block; } </style>
<flatiron-director route="{{route}}" hidden=""></flatiron-director>
<section id="todoapp">
......@@ -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">
<label for="toggle-all">Mark all as complete</label>
<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>
</template>
</ul>
......@@ -57,7 +57,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
<footer id="footer">
<span id="todo-count">
<strong>{{activeCount}}</strong>
<span>{{_computeItemsLeft(activeCount)}}</span> left
<span>{{_computeItemsLeft(activeCount)}}</span><span> left</span>
</span>
<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
</li>
</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>
</template>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,8 +2,8 @@
<link rel="import" href="td-input.html">
<dom-module id="td-item">
<template>
<template is="dom-if" if="{{!editing}}">
<template strip-whitespace>
<template is="dom-if" if="{{!editing}}" strip-whitespace>
<div on-dblclick="_editAction">
<input type="checkbox" class="toggle"
checked="{{item.completed::change}}">
......@@ -11,7 +11,7 @@
<button class="destroy" on-tap="_destroyAction"></button>
</div>
</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"
......
......@@ -2,7 +2,7 @@
<link rel="import" href="../bower_components/iron-localstorage/iron-localstorage.html">
<dom-module id="td-model">
<template>
<template strip-whitespace>
<iron-localstorage name="todos-polymer" value="{{items}}"
on-iron-localstorage-load-empty="_initializeDefaultTodos"></iron-localstorage>
</template>
......
......@@ -5,7 +5,7 @@
<link rel="import" href="td-item.html">
<dom-module id="td-todos">
<template>
<template strip-whitespace>
<style>
:host {
display: block;
......@@ -27,7 +27,9 @@
<label for="toggle-all">Mark all as complete</label>
<ul id="todo-list" on-td-destroy-item="destroyItemAction">
<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>
</template>
</ul>
......@@ -36,7 +38,7 @@
<footer id="footer">
<span id="todo-count">
<strong>{{activeCount}}</strong>
<span>{{_computeItemsLeft(activeCount)}}</span> left
<span>{{_computeItemsLeft(activeCount)}}</span><span> left</span>
</span>
<iron-selector id="filters" selected="{{route}}" attr-for-selected="route">
......@@ -51,7 +53,7 @@
</li>
</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>
</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