| Index: third_party/polymer/v1_0/components/polymer/polymer.html
|
| diff --git a/third_party/polymer/v1_0/components/polymer/polymer.html b/third_party/polymer/v1_0/components/polymer/polymer.html
|
| index 89e28a32df2f9f51ade61f5611fc13dcf5a1e2da..de1a20bc985ceeeeac8615d9a17806eec0eb8ba4 100644
|
| --- a/third_party/polymer/v1_0/components/polymer/polymer.html
|
| +++ b/third_party/polymer/v1_0/components/polymer/polymer.html
|
| @@ -546,6 +546,16 @@ var recognizers = Gestures.recognizers;
|
| for (var i = 0, r; i < recognizers.length; i++) {
|
| r = recognizers[i];
|
| if (gs[r.name] && !handled[r.name]) {
|
| +if (r.flow && r.flow.start.indexOf(ev.type) > -1) {
|
| +if (r.reset) {
|
| +r.reset();
|
| +}
|
| +}
|
| +}
|
| +}
|
| +for (var i = 0, r; i < recognizers.length; i++) {
|
| +r = recognizers[i];
|
| +if (gs[r.name] && !handled[r.name]) {
|
| handled[r.name] = true;
|
| r[type](ev);
|
| }
|
| @@ -577,6 +587,8 @@ prevent = dx > dy;
|
| }
|
| if (prevent) {
|
| ev.preventDefault();
|
| +} else {
|
| +Gestures.prevent('track');
|
| }
|
| }
|
| },
|
| @@ -718,6 +730,16 @@ deps: [
|
| 'touchmove',
|
| 'touchend'
|
| ],
|
| +flow: {
|
| +start: [
|
| +'mousedown',
|
| +'touchstart'
|
| +],
|
| +end: [
|
| +'mouseup',
|
| +'touchend'
|
| +]
|
| +},
|
| emits: ['track'],
|
| info: {
|
| x: 0,
|
| @@ -733,7 +755,7 @@ this.moves.push(move);
|
| },
|
| prevent: false
|
| },
|
| -clearInfo: function () {
|
| +reset: function () {
|
| this.info.state = 'start';
|
| this.info.started = false;
|
| this.info.moves = [];
|
| @@ -772,7 +794,6 @@ if (self.info.started) {
|
| Gestures.prevent('tap');
|
| movefn(e);
|
| }
|
| -self.clearInfo();
|
| document.removeEventListener('mousemove', movefn);
|
| document.removeEventListener('mouseup', upfn);
|
| };
|
| @@ -812,7 +833,6 @@ y: ct.clientY
|
| });
|
| this.fire(t, ct);
|
| }
|
| -this.clearInfo();
|
| },
|
| fire: function (target, touch) {
|
| var secondlast = this.info.moves[this.info.moves.length - 2];
|
| @@ -847,6 +867,16 @@ deps: [
|
| 'touchstart',
|
| 'touchend'
|
| ],
|
| +flow: {
|
| +start: [
|
| +'mousedown',
|
| +'touchstart'
|
| +],
|
| +end: [
|
| +'click',
|
| +'touchend'
|
| +]
|
| +},
|
| emits: ['tap'],
|
| info: {
|
| x: NaN,
|
| @@ -887,7 +917,6 @@ sourceEvent: e
|
| });
|
| }
|
| }
|
| -this.reset();
|
| }
|
| });
|
| var DIRECTION_MAP = {
|
| @@ -1584,7 +1613,12 @@ this._effectEffects('__static__', null, this._propertyEffects.__static__);
|
| });
|
| Polymer.Base._addFeature({
|
| _setupConfigure: function (initialConfig) {
|
| -this._config = initialConfig || {};
|
| +this._config = {};
|
| +for (var i in initialConfig) {
|
| +if (initialConfig[i] !== undefined) {
|
| +this._config[i] = initialConfig[i];
|
| +}
|
| +}
|
| this._handlers = [];
|
| },
|
| _marshalAttributes: function () {
|
| @@ -1713,8 +1747,9 @@ var array;
|
| var last = parts[parts.length - 1];
|
| if (parts.length > 1) {
|
| for (var i = 0; i < parts.length - 1; i++) {
|
| -prop = prop[parts[i]];
|
| -if (array) {
|
| +var part = parts[i];
|
| +prop = prop[part];
|
| +if (array && parseInt(part) == part) {
|
| parts[i] = Polymer.Collection.get(array).getKey(prop);
|
| }
|
| if (!prop) {
|
| @@ -1722,15 +1757,13 @@ return;
|
| }
|
| array = Array.isArray(prop) ? prop : null;
|
| }
|
| -if (array) {
|
| +if (array && parseInt(last) == last) {
|
| var coll = Polymer.Collection.get(array);
|
| var old = prop[last];
|
| var key = coll.getKey(old);
|
| -if (key) {
|
| parts[i] = key;
|
| coll.setItem(key, value);
|
| }
|
| -}
|
| prop[last] = value;
|
| if (!root) {
|
| this.notifyPath(parts.join('.'), value);
|
| @@ -2826,6 +2859,7 @@ Polymer.Base._addFeature({
|
| _prepStyleProperties: function () {
|
| this._ownStylePropertyNames = this._styles ? propertyUtils.decorateStyles(this._styles) : [];
|
| },
|
| +customStyle: {},
|
| _setupStyleProperties: function () {
|
| this.customStyle = {};
|
| },
|
| @@ -3057,15 +3091,8 @@ styleTransformer.documentRule(rule);
|
| }());
|
| Polymer.Templatizer = {
|
| properties: { __hideTemplateChildren__: { observer: '_showHideChildren' } },
|
| -_templatizerStatic: {
|
| -count: 0,
|
| -callbacks: {},
|
| -debouncer: null
|
| -},
|
| _instanceProps: Polymer.nob,
|
| -created: function () {
|
| -this._templatizerId = this._templatizerStatic.count++;
|
| -},
|
| +_parentPropPrefix: '_parent_',
|
| templatize: function (template) {
|
| if (!template._content) {
|
| template._content = template.content;
|
| @@ -3109,20 +3136,10 @@ n.__hideTemplateChildren__ = hide;
|
| }
|
| },
|
| _debounceTemplate: function (fn) {
|
| -this._templatizerStatic.callbacks[this._templatizerId] = fn.bind(this);
|
| -this._templatizerStatic.debouncer = Polymer.Debounce(this._templatizerStatic.debouncer, this._flushTemplates.bind(this, true));
|
| +Polymer.dom.addDebouncer(this.debounce('_debounceTemplate', fn));
|
| },
|
| _flushTemplates: function (debouncerExpired) {
|
| -var db = this._templatizerStatic.debouncer;
|
| -while (debouncerExpired || db && db.finish) {
|
| -db.stop();
|
| -var cbs = this._templatizerStatic.callbacks;
|
| -this._templatizerStatic.callbacks = {};
|
| -for (var id in cbs) {
|
| -cbs[id]();
|
| -}
|
| -debouncerExpired = false;
|
| -}
|
| +Polymer.dom.flush();
|
| },
|
| _customPrepEffects: function (archetype) {
|
| var parentProps = archetype._parentProps;
|
| @@ -3162,7 +3179,7 @@ if (template != this) {
|
| Polymer.Bind.prepareModel(proto);
|
| }
|
| for (prop in parentProps) {
|
| -var parentProp = '_parent_' + prop;
|
| +var parentProp = this._parentPropPrefix + prop;
|
| var effects = [
|
| {
|
| kind: 'function',
|
| @@ -3186,8 +3203,9 @@ this._forwardParentProp(prop, value);
|
| };
|
| },
|
| _createHostPropEffector: function (prop) {
|
| +var prefix = this._parentPropPrefix;
|
| return function (source, value) {
|
| -this.dataHost['_parent_' + prop] = value;
|
| +this.dataHost[prefix + prop] = value;
|
| };
|
| },
|
| _createInstancePropEffector: function (prop) {
|
| @@ -3219,12 +3237,12 @@ var dot = path.indexOf('.');
|
| var root = dot < 0 ? path : path.slice(0, dot);
|
| dataHost._forwardInstancePath.call(dataHost, this, path, value);
|
| if (root in dataHost._parentProps) {
|
| -dataHost.notifyPath('_parent_' + path, value);
|
| +dataHost.notifyPath(dataHost._parentPropPrefix + path, value);
|
| }
|
| },
|
| _pathEffector: function (path, value, fromAbove) {
|
| if (this._forwardParentPath) {
|
| -if (path.indexOf('_parent_') === 0) {
|
| +if (path.indexOf(this._parentPropPrefix) === 0) {
|
| this._forwardParentPath(path.substring(8), value);
|
| }
|
| }
|
| @@ -3272,7 +3290,7 @@ stamp: function (model) {
|
| model = model || {};
|
| if (this._parentProps) {
|
| for (var prop in this._parentProps) {
|
| -model[prop] = this['_parent_' + prop];
|
| +model[prop] = this[this._parentPropPrefix + prop];
|
| }
|
| }
|
| return new this.ctor(model, this);
|
| @@ -3988,7 +4006,16 @@ Polymer({
|
| is: 'dom-bind',
|
| extends: 'template',
|
| created: function () {
|
| -Polymer.ImportStatus.whenLoaded(this._readySelf.bind(this));
|
| +Polymer.ImportStatus.whenLoaded(this._markImportsReady.bind(this));
|
| +},
|
| +_ensureReady: function () {
|
| +if (!this._readied) {
|
| +this._readySelf();
|
| +}
|
| +},
|
| +_markImportsReady: function () {
|
| +this._importsReady = true;
|
| +this._ensureReady();
|
| },
|
| _registerFeatures: function () {
|
| this._prepConstructor();
|
| @@ -4021,6 +4048,15 @@ config[prop] = this[prop];
|
| this._setupConfigure = this._setupConfigure.bind(this, config);
|
| },
|
| attached: function () {
|
| +if (this._importsReady) {
|
| +this.render();
|
| +}
|
| +},
|
| +detached: function () {
|
| +this._removeChildren();
|
| +},
|
| +render: function () {
|
| +this._ensureReady();
|
| if (!this._children) {
|
| this._template = this;
|
| this._prepAnnotations();
|
| @@ -4033,8 +4069,5 @@ this._children = Array.prototype.slice.call(this.root.childNodes);
|
| }
|
| this._insertChildren();
|
| this.fire('dom-change');
|
| -},
|
| -detached: function () {
|
| -this._removeChildren();
|
| }
|
| });</script>
|
|
|