Skip to content

Commit f04a205

Browse files
committed
remove destroy() method
1 parent 3f2c831 commit f04a205

File tree

1 file changed

+9
-24
lines changed

1 file changed

+9
-24
lines changed

jquery.scroll-direction.js

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,43 +24,28 @@
2424
extraIndicators: {}
2525
};
2626

27-
// Events
28-
let scrollDirection = $.Event("scrollDirection"),
29-
scrollDown = $.Event("scrollDown"),
30-
scrollUp = $.Event("scrollUp"),
31-
scrollAtTop = $.Event("scrollAtTop"),
32-
scrollAtMiddle = $.Event("scrollAtMiddle"),
33-
scrollAtBottom = $.Event("scrollAtBottom");
34-
3527
// Method: init()
3628
obj.init = function (options) {
3729
pluginActive = true;
3830
// update settings
3931
settings = $.extend(settings, options);
4032
};
4133

42-
// Method: destroy()
43-
obj.destroy = function () {
44-
pluginActive = false;
45-
46-
// update states
47-
obj.isScrollUp = false;
48-
obj.isScrollDown = false;
49-
obj.isScrollAtTop = false;
50-
obj.isScrollAtMiddle = false;
51-
obj.isScrollAtBottom = false;
52-
53-
// remove all indicators
54-
indicator();
55-
};
56-
5734
// APIs
5835
obj.isScrollUp = false;
5936
obj.isScrollDown = false;
6037
obj.isScrollAtTop = false;
6138
obj.isScrollAtMiddle = false;
6239
obj.isScrollAtBottom = false;
6340

41+
// Events
42+
let scrollDirection = $.Event("scrollDirection"),
43+
scrollDown = $.Event("scrollDown"),
44+
scrollUp = $.Event("scrollUp"),
45+
scrollAtTop = $.Event("scrollAtTop"),
46+
scrollAtMiddle = $.Event("scrollAtMiddle"),
47+
scrollAtBottom = $.Event("scrollAtBottom");
48+
6449
// Indicator: add class to indicate the scrolling status
6550
function indicator(options) {
6651
if (settings.indicator) {
@@ -174,7 +159,7 @@
174159
for (i; i < l; i++) {
175160
indicator({
176161
"values": [scrollAmount >= settings.extraIndicators[i]["element"].offset().top],
177-
"classes": [settings.extraIndicators[i]["indicator"]]
162+
"classes": [settings.extraIndicators[i]["class"]]
178163
});
179164
}
180165

0 commit comments

Comments
 (0)