Closed LordMidi closed 8 years ago
That's a good point. I'll mark it as a bug and fix it right away. I'll notify you when I made a new patch.
I fixed it, here you go. Thanks for spotting this.
Thx for your efforts. I've updated to 0.2.2 but in my case if (!stickyElementCollection.trackedElements.length) {
always validated to true (stickyElementCollection.trackedElements.length is always 0) so there is no change in the behaviour.
Well, that's embarrassing... Please update to `0.2.3`` and see if that works.
I forgot trackedElements
was a function and needed to be called as such.
Nice. It works. Many thanks for your instant help!
(just one note - maybe you want to switch to 2 spaces instead of tabs for indent. I think it's more common these days)
see ya
You're welcome, thanks for the issue report again.
The age old indent war, haha. Even though it might be more popular, I feel with a bit more indentation it's easier to read. So that's why I decided to stick with that. But one advantage of tabs is that you can tell your IDE how to interpret a tab. So if you prefer 2 spaces, you can simply pretend ;)
We have several sticky elements. Some of them are included in view of states from the ui-router. So if there is a state change, the destroy function of the sticky elements which are not available anymore is fired. But here the stickyness of all elements gets removed, even those which should stay sticky.
You should only destroy the 'hlSticky' Directive which fires the destroy function, not ALL!
$scope.$on('$destroy', function onDestroy() { stickyElementCollection.destroy(); });