Skip to content

Commit dd03f3a

Browse files
authored
🐛 Fix events not working
Sometimes we forget stuff... Fixes #3
1 parent aafb7cd commit dd03f3a

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

angular-sticky-kit.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ angular.module("angular-sticky-kit", [])
2626
options[attrname] = customOptions[attrname];
2727
}
2828
stickyElement = element.stick_in_parent(options);
29-
if (typeof stick !== "undefined" && stick !== null) {
30-
element.on("sticky_kit:stick", stick);
29+
if (typeof options.stick !== "undefined" && options.stick !== null) {
30+
element.on("sticky_kit:stick", options.stick);
3131
}
32-
if (typeof unstick !== "undefined" && unstick !== null) {
33-
element.on("sticky_kit:unstick", unstick);
32+
if (typeof options.unstick !== "undefined" && options.unstick !== null) {
33+
element.on("sticky_kit:unstick", options.unstick);
3434
}
35-
if (typeof bottom !== "undefined" && bottom !== null) {
36-
element.on("sticky_kit:bottom", bottom);
35+
if (typeof options.bottom !== "undefined" && options.bottom !== null) {
36+
element.on("sticky_kit:bottom", options.bottom);
3737
}
38-
if (typeof unbottom !== "undefined" && unbottom !== null) {
39-
element.on("sticky_kit:unbottom", unbottom);
38+
if (typeof options.unbottom !== "undefined" && options.unbottom !== null) {
39+
element.on("sticky_kit:unbottom", options.unbottom);
4040
}
41-
if (typeof recalc !== "undefined" && recalc !== null) {
42-
element.on("sticky_kit:recalc", recalc);
41+
if (typeof options.recalc !== "undefined" && options.recalc !== null) {
42+
element.on("sticky_kit:recalc", options.recalc);
4343
}
44-
if (typeof detach !== "undefined" && detach !== null) {
45-
return element.on("sticky_kit:detach", detach);
44+
if (typeof options.detach !== "undefined" && options.detach !== null) {
45+
return element.on("sticky_kit:detach", options.detach);
4646
}
4747
}
4848
};

0 commit comments

Comments
 (0)