Skip to content

Commit

Permalink
make _currentDfd function specific
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphsmith80 committed Jul 18, 2012
1 parent c952380 commit f6d46cc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/widgets/queryable.js
Expand Up @@ -2,8 +2,7 @@ define([
'vendor/jquery',
'vendor/underscore'
], function ($, _) {
var _currentDfd,
remove = function(array, obj) {
var remove = function(array, obj) {
var idx = _.indexOf(array, obj);
if (idx >= -1) {
array.splice(idx, 1);
Expand All @@ -18,13 +17,13 @@ define([

//Filter Success
function(value) {
if(dfd !== _currentDfd) {
if(dfd !== self._currentDfd) {
remove(self._currentDfds, dfd);
return $.Deferred().reject();
}
// self._currentDfds.length = 0;
remove(self._currentDfds, dfd);
_currentDfd = undefined;
self._currentDfd = undefined;
return this.resolve();
},

Expand All @@ -36,7 +35,7 @@ define([
);

(self._currentDfds = self._currentDfds || []).push(dfd);
_currentDfd = dfd;
self._currentDfd = dfd;
return dfd;
}
};
Expand Down

0 comments on commit f6d46cc

Please sign in to comment.