Skip to content

Commit

Permalink
Released 0.5.6.
Browse files Browse the repository at this point in the history
  • Loading branch information
oblador committed May 12, 2014
1 parent ffb7439 commit ca9c5e4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 5 deletions.
13 changes: 12 additions & 1 deletion angular-scroll.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,17 @@ angular.module('duScroll.spyAPI', ['duScroll.scrollContainerAPI']).factory('spyA
return contexts[defaultContextId];
};
var getContextForSpy = function (spy) {
return getContextForScope(spy.$element.scope());
var context, contextId, scope = spy.$element.scope();
if (scope) {
return getContextForScope(scope);
}
//No scope, most likely destroyed
for (contextId in contexts) {
context = contexts[contextId];
if (context.spies.indexOf(spy) !== -1) {
return context;
}
}
};
var addSpy = function (spy) {
var context = getContextForSpy(spy);
Expand Down Expand Up @@ -436,6 +446,7 @@ angular.module('duScroll.scrollspy', ['duScroll.spyAPI']).directive('duScrollspy
spyAPI.removeSpy(spy);
});
$scope.$on('$locationChangeSuccess', spy.flushTargetCache.bind(spy));
$scope.$on('$stateChangeSuccess', spy.flushTargetCache.bind(spy));
}, 0);
}
};
Expand Down
2 changes: 1 addition & 1 deletion angular-scroll.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit ca9c5e4

Please sign in to comment.