-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stop stickyfill when the component is removed from the dom
- Loading branch information
Corey Wilson
committed
Mar 4, 2016
1 parent
84baca5
commit e54519d
Showing
1 changed file
with
7 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* An Angular directive for stickyfill (position sticky polyfill) | ||
* @version v0.0.2 - 2016-03-02 | ||
* @author corey wilson <[email protected]> | ||
* @version v0.0.3 - 2016-03-04 | ||
* @author Corey Wilson <[email protected]> | ||
* @license Unlicense, http://unlicense.org/ | ||
*/ | ||
(function (window, angular) { | ||
|
@@ -23,7 +23,11 @@ | |
throw new Error('stickyfill.js not loaded') | ||
} | ||
|
||
window.Stickyfill.add(element[0]) | ||
window.Stickyfill.add(element[0]); | ||
|
||
scope.$on('$destroy', function() { | ||
window.Stickyfill.remove(element[0]); | ||
}); | ||
} | ||
} | ||
})(window, window.angular); |