[Pkg-javascript-commits] [dojo] 107/149: fixes #18069, make Observable work with relational data

David Prévot taffit at moszumanska.debian.org
Sat Feb 27 03:13:53 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository dojo.

commit c7b154cae5cd209d1b4723404033fe97f7f5e5ec
Author: wshager <wshager at gmail.com>
Date:   Fri Dec 25 07:28:35 2015 -0700

    fixes #18069, make Observable work with relational data
---
 store/Observable.js | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/store/Observable.js b/store/Observable.js
index b33e72e..e11da5d 100644
--- a/store/Observable.js
+++ b/store/Observable.js
@@ -71,9 +71,14 @@ var Observable = function(/*Store*/ store){
 							var removedObject, removedFrom = -1, insertedInto = -1;
 							if(existingId !== undef){
 								// remove the old one
+								var filteredArray = [].concat(resultsArray);
+								if(queryExecutor && !changed){
+									filteredArray = queryExecutor(resultsArray);
+								}
 								for(i = 0, l = resultsArray.length; i < l; i++){
 									var object = resultsArray[i];
 									if(store.getIdentity(object) == existingId){
+										if(filteredArray.indexOf(object)<0) continue;
 										removedObject = object;
 										removedFrom = i;
 										if(queryExecutor || !changed){// if it was changed and we don't have a queryExecutor, we shouldn't remove it because updated objects would be eliminated

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/dojo.git



More information about the Pkg-javascript-commits mailing list