Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(561)

Unified Diff: lib/src/firebase-element/firebase-query-behavior.html

Issue 1418513006: update elements and fix some bugs (Closed) Base URL: git@github.com:dart-lang/polymer_elements.git@master
Patch Set: code review updates Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: lib/src/firebase-element/firebase-query-behavior.html
diff --git a/lib/src/firebase-element/firebase-query-behavior.html b/lib/src/firebase-element/firebase-query-behavior.html
index bfba3529f55d440aadf15e99c418646dd6099efb..7c672434883b08bd53d4dabd49bd26c076125958 100644
--- a/lib/src/firebase-element/firebase-query-behavior.html
+++ b/lib/src/firebase-element/firebase-query-behavior.html
@@ -40,11 +40,6 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
type: Boolean,
value: false,
reflectToAttribute: true
- },
-
- _receivingRemoteChanges: {
- type: Boolean,
- value: false
}
},
@@ -52,6 +47,11 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
'_dataChanged(data.*)'
],
+ created: function() {
+ this._receivingLocalChanges = false;
+ this._receivingRemoteChanges = false;
+ },
+
get dataAsObject() {
if (Array.isArray(this.data)) {
return this.data.reduce(function(object, value, index) {
@@ -69,27 +69,29 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
this.location = '';
},
- _applyLocalDataChanges: function(changes) {
+ _localDataChanged: function(changes) {
// Virtual..
},
+ _applyLocalDataChange: function(applyChange) {
+ this._receivingLocalChanges = true;
+ applyChange.call(this);
+ this._receivingLocalChanges = false;
+ },
+
_applyRemoteDataChange: function(applyChange) {
- if (this._applyingLocalDataChanges) {
- return;
- }
this._receivingRemoteChanges = true;
applyChange.call(this);
this._receivingRemoteChanges = false;
},
_dataChanged: function(changes) {
- if (this._receivingRemoteChanges) {
+ if (this._receivingRemoteChanges ||
+ this._receivingLocalChanges) {
return;
}
- this._applyingLocalDataChanges = true;
- this._applyLocalDataChanges(changes);
- this._applyingLocalDataChanges = false;
+ this._localDataChanged(changes);
},
_queryChanged: function(query, oldQuery) {
@@ -181,9 +183,15 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
}
},
+ _warn: function() {
+ if (this.log) {
+ Polymer.Base._warn(this._logf.apply(this, arguments));
+ }
+ },
+
_error: function() {
if (this.log) {
- console.error.apply(console, arguments);
+ Polymer.Base._error(this._logf.apply(this, arguments));
}
}
};
« no previous file with comments | « lib/src/firebase-element/firebase-document.html ('k') | lib/src/firebase-element/test/firebase-collection.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698