nodebb-theme-persona 13.3.32 → 13.3.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +2 -2
- package/README.md +20 -20
- package/lib/controllers.js +24 -24
- package/library.js +97 -97
- package/package.json +52 -52
- package/plugin.json +20 -20
- package/public/.eslintrc +2 -2
- package/public/admin.js +15 -15
- package/public/modules/autohidingnavbar.js +220 -220
- package/public/modules/mobile-menu.js +190 -190
- package/public/modules/taskbar.js +65 -65
- package/public/persona.js +257 -257
- package/public/settings.js +53 -53
- package/scss/account.scss +336 -336
- package/scss/categories.scss +205 -205
- package/scss/category.scss +161 -161
- package/scss/chats.scss +14 -14
- package/scss/flags.scss +42 -42
- package/scss/footer.scss +16 -16
- package/scss/groups.scss +166 -166
- package/scss/header.scss +229 -361
- package/scss/keyframes.scss +152 -152
- package/scss/mixins.scss +129 -129
- package/scss/mobile.scss +222 -331
- package/scss/modules/composer.scss +20 -20
- package/scss/modules/cookie-consent.scss +12 -12
- package/scss/modules/fab.scss +32 -32
- package/scss/modules/morph.scss +268 -268
- package/scss/modules/necro-post.scss +8 -8
- package/scss/modules/nprogress.scss +80 -80
- package/scss/modules/taskbar.scss +160 -160
- package/scss/modules/user-menu.scss +7 -7
- package/scss/modules/usercard.scss +64 -64
- package/scss/noscript.scss +80 -80
- package/scss/overrides.scss +39 -39
- package/scss/persona.scss +34 -34
- package/scss/posts_list.scss +127 -127
- package/scss/search.scss +48 -48
- package/scss/style.scss +256 -256
- package/scss/tags.scss +10 -10
- package/scss/topic.scss +571 -571
- package/scss/topics_list.scss +16 -16
- package/scss/variables.scss +6 -6
- package/templates/account/blocks.tpl +46 -46
- package/templates/account/categories.tpl +28 -28
- package/templates/account/consent.tpl +68 -68
- package/templates/account/edit/password.tpl +29 -29
- package/templates/account/edit/username.tpl +25 -25
- package/templates/account/edit.tpl +136 -136
- package/templates/account/followers.tpl +17 -17
- package/templates/account/following.tpl +17 -17
- package/templates/account/groups.tpl +16 -16
- package/templates/account/info.tpl +291 -291
- package/templates/account/posts.tpl +18 -18
- package/templates/account/profile.tpl +166 -166
- package/templates/account/sessions.tpl +31 -31
- package/templates/account/settings.tpl +251 -251
- package/templates/account/tags.tpl +9 -9
- package/templates/account/theme.tpl +25 -25
- package/templates/account/topics.tpl +29 -29
- package/templates/account/uploads.tpl +42 -42
- package/templates/admin/plugins/persona.tpl +24 -24
- package/templates/categories.tpl +31 -31
- package/templates/category.tpl +63 -63
- package/templates/flags/detail.tpl +208 -208
- package/templates/flags/list.tpl +71 -71
- package/templates/footer.tpl +11 -11
- package/templates/groups/details.tpl +77 -77
- package/templates/groups/list.tpl +48 -48
- package/templates/groups/members.tpl +5 -5
- package/templates/header.tpl +47 -47
- package/templates/modules/taskbar.tpl +2 -2
- package/templates/modules/usercard.tpl +36 -36
- package/templates/notifications.tpl +66 -66
- package/templates/partials/account/category-item.tpl +23 -23
- package/templates/partials/account/header.tpl +47 -47
- package/templates/partials/account/menu.tpl +108 -108
- package/templates/partials/breadcrumbs.tpl +18 -18
- package/templates/partials/buttons/newTopic.tpl +22 -22
- package/templates/partials/categories/item.tpl +60 -60
- package/templates/partials/categories/lastpost.tpl +26 -26
- package/templates/partials/category/filter-dropdown-content.tpl +31 -31
- package/templates/partials/category/selector-dropdown-content.tpl +32 -32
- package/templates/partials/category/sort.tpl +14 -14
- package/templates/partials/category/subcategory.tpl +17 -17
- package/templates/partials/category/tags.tpl +3 -3
- package/templates/partials/category/tools.tpl +86 -86
- package/templates/partials/category/watch.tpl +55 -55
- package/templates/partials/chats-menu.tpl +41 -40
- package/templates/partials/cookie-consent.tpl +4 -4
- package/templates/partials/flags/filters.tpl +173 -173
- package/templates/partials/groups/admin.tpl +200 -200
- package/templates/partials/groups/filter-dropdown-content.tpl +24 -24
- package/templates/partials/groups/list.tpl +20 -20
- package/templates/partials/groups/memberlist.tpl +42 -42
- package/templates/partials/header/chats.tpl +18 -18
- package/templates/partials/header/notifications.tpl +49 -19
- package/templates/partials/header/search.tpl +24 -24
- package/templates/partials/header/user-menu.tpl +96 -96
- package/templates/partials/menu.tpl +128 -128
- package/templates/partials/notifications_list.tpl +44 -30
- package/templates/partials/paginator.tpl +44 -44
- package/templates/partials/post_bar.tpl +20 -20
- package/templates/partials/posts_list.tpl +7 -7
- package/templates/partials/posts_list_item.tpl +31 -31
- package/templates/partials/quick-search-results.tpl +33 -33
- package/templates/partials/search-filters.tpl +183 -183
- package/templates/partials/search-results.tpl +54 -54
- package/templates/partials/slideout-menu.tpl +4 -4
- package/templates/partials/tags/filter-dropdown-content.tpl +33 -33
- package/templates/partials/tags/watch.tpl +35 -35
- package/templates/partials/tags_list.tpl +4 -4
- package/templates/partials/toast.tpl +19 -19
- package/templates/partials/topic/event.tpl +12 -12
- package/templates/partials/topic/navigation-post.tpl +11 -11
- package/templates/partials/topic/navigator.tpl +39 -39
- package/templates/partials/topic/necro-post.tpl +2 -2
- package/templates/partials/topic/post-menu-list.tpl +132 -132
- package/templates/partials/topic/post-menu.tpl +4 -4
- package/templates/partials/topic/post.tpl +128 -128
- package/templates/partials/topic/quickreply.tpl +28 -28
- package/templates/partials/topic/reply-button.tpl +26 -26
- package/templates/partials/topic/selection-tooltip.tpl +2 -2
- package/templates/partials/topic/sort.tpl +9 -9
- package/templates/partials/topic/stats.tpl +11 -11
- package/templates/partials/topic/tags.tpl +2 -2
- package/templates/partials/topic/tools.tpl +7 -7
- package/templates/partials/topic/topic-menu-list.tpl +74 -74
- package/templates/partials/topic/watch.tpl +47 -47
- package/templates/partials/topic-filters.tpl +11 -11
- package/templates/partials/topic-terms.tpl +11 -11
- package/templates/partials/topics_list.tpl +117 -117
- package/templates/partials/users/filter-dropdown-content.tpl +20 -20
- package/templates/partials/users/item.tpl +43 -43
- package/templates/partials/users_list.tpl +14 -14
- package/templates/partials/users_list_menu.tpl +20 -20
- package/templates/popular.tpl +35 -35
- package/templates/recent.tpl +37 -37
- package/templates/search.tpl +47 -47
- package/templates/tag.tpl +34 -34
- package/templates/tags.tpl +32 -32
- package/templates/top.tpl +35 -35
- package/templates/topic.tpl +129 -129
- package/templates/unread.tpl +37 -37
- package/templates/users.tpl +34 -34
|
@@ -1,221 +1,221 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Bootstrap Auto-Hiding Navbar - v4.0.0
|
|
3
|
-
* An extension for Bootstrap's fixed navbar which hides the navbar while the page is scrolling downwards and shows it the other way. The plugin is able to show/hide the navbar programmatically as well.
|
|
4
|
-
* http://www.virtuosoft.eu/code/bootstrap-autohidingnavbar/
|
|
5
|
-
*
|
|
6
|
-
* Made by István Ujj-Mészáros
|
|
7
|
-
* Under Apache License v2.0 License
|
|
8
|
-
*/
|
|
9
|
-
;(function($, window, document, undefined) {
|
|
10
|
-
var pluginName = 'autoHidingNavbar',
|
|
11
|
-
$window = $(window),
|
|
12
|
-
$document = $(document),
|
|
13
|
-
_scrollThrottleTimer = null,
|
|
14
|
-
_resizeThrottleTimer = null,
|
|
15
|
-
_throttleDelay = 70,
|
|
16
|
-
_lastScrollHandlerRun = 0,
|
|
17
|
-
_previousScrollTop = null,
|
|
18
|
-
_windowHeight = $window.height(),
|
|
19
|
-
_visible = true,
|
|
20
|
-
_hideOffset,
|
|
21
|
-
defaults = {
|
|
22
|
-
disableAutohide: false,
|
|
23
|
-
showOnUpscroll: true,
|
|
24
|
-
showOnBottom: true,
|
|
25
|
-
hideOffset: 'auto', // "auto" means the navbar height
|
|
26
|
-
animationDuration: 200,
|
|
27
|
-
navbarOffset: 0
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
function AutoHidingNavbar(element, options) {
|
|
31
|
-
this.element = $(element);
|
|
32
|
-
this.settings = $.extend({}, defaults, options);
|
|
33
|
-
this._defaults = defaults;
|
|
34
|
-
this._name = pluginName;
|
|
35
|
-
this.init();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function hide(autoHidingNavbar) {
|
|
39
|
-
if (!_visible) {
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
autoHidingNavbar.element.addClass('navbar-hidden').animate({
|
|
44
|
-
top: -1 * parseInt(autoHidingNavbar.element.css('height'), 10) + autoHidingNavbar.settings.navbarOffset
|
|
45
|
-
}, {
|
|
46
|
-
queue: false,
|
|
47
|
-
duration: autoHidingNavbar.settings.animationDuration
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
try {
|
|
51
|
-
$('.dropdown.open .dropdown-toggle, .dropdown.show .dropdown-toggle', autoHidingNavbar.element).dropdown('toggle');
|
|
52
|
-
}
|
|
53
|
-
catch(e) {}
|
|
54
|
-
|
|
55
|
-
_visible = false;
|
|
56
|
-
|
|
57
|
-
autoHidingNavbar.element.trigger('hide.autoHidingNavbar');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
function show(autoHidingNavbar) {
|
|
61
|
-
if (_visible) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
autoHidingNavbar.element.removeClass('navbar-hidden').animate({
|
|
66
|
-
top: 0
|
|
67
|
-
}, {
|
|
68
|
-
queue: false,
|
|
69
|
-
duration: autoHidingNavbar.settings.animationDuration
|
|
70
|
-
});
|
|
71
|
-
_visible = true;
|
|
72
|
-
|
|
73
|
-
autoHidingNavbar.element.trigger('show.autoHidingNavbar');
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function detectState(autoHidingNavbar) {
|
|
77
|
-
var scrollTop = $window.scrollTop(),
|
|
78
|
-
scrollDelta = scrollTop - _previousScrollTop;
|
|
79
|
-
|
|
80
|
-
_previousScrollTop = scrollTop;
|
|
81
|
-
|
|
82
|
-
if (scrollDelta < 0) {
|
|
83
|
-
if (_visible) {
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
if (autoHidingNavbar.settings.showOnUpscroll || scrollTop <= _hideOffset) {
|
|
88
|
-
show(autoHidingNavbar);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else if (scrollDelta > 0) {
|
|
92
|
-
if (!_visible) {
|
|
93
|
-
if (autoHidingNavbar.settings.showOnBottom && scrollTop + _windowHeight === $document.height()) {
|
|
94
|
-
show(autoHidingNavbar);
|
|
95
|
-
}
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (scrollTop >= _hideOffset) {
|
|
100
|
-
hide(autoHidingNavbar);
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
function scrollHandler(autoHidingNavbar) {
|
|
107
|
-
if (autoHidingNavbar.settings.disableAutohide) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
_lastScrollHandlerRun = new Date().getTime();
|
|
112
|
-
|
|
113
|
-
detectState(autoHidingNavbar);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
function bindEvents(autoHidingNavbar) {
|
|
117
|
-
$document.on('scroll.' + pluginName, function() {
|
|
118
|
-
if (new Date().getTime() - _lastScrollHandlerRun > _throttleDelay) {
|
|
119
|
-
scrollHandler(autoHidingNavbar);
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
clearTimeout(_scrollThrottleTimer);
|
|
123
|
-
_scrollThrottleTimer = setTimeout(function() {
|
|
124
|
-
scrollHandler(autoHidingNavbar);
|
|
125
|
-
}, _throttleDelay);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
$window.on('resize.' + pluginName, function() {
|
|
130
|
-
clearTimeout(_resizeThrottleTimer);
|
|
131
|
-
_resizeThrottleTimer = setTimeout(function() {
|
|
132
|
-
_windowHeight = $window.height();
|
|
133
|
-
}, _throttleDelay);
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
function unbindEvents() {
|
|
138
|
-
$document.off('.' + pluginName);
|
|
139
|
-
|
|
140
|
-
$window.off('.' + pluginName);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
AutoHidingNavbar.prototype = {
|
|
144
|
-
init: function() {
|
|
145
|
-
this.elements = {
|
|
146
|
-
navbar: this.element
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
this.setDisableAutohide(this.settings.disableAutohide);
|
|
150
|
-
this.setShowOnUpscroll(this.settings.showOnUpscroll);
|
|
151
|
-
this.setShowOnBottom(this.settings.showOnBottom);
|
|
152
|
-
this.setHideOffset(this.settings.hideOffset);
|
|
153
|
-
this.setAnimationDuration(this.settings.animationDuration);
|
|
154
|
-
|
|
155
|
-
_hideOffset = this.settings.hideOffset === 'auto' ? parseInt(this.element.css('height'), 10) : this.settings.hideOffset;
|
|
156
|
-
bindEvents(this);
|
|
157
|
-
|
|
158
|
-
return this.element;
|
|
159
|
-
},
|
|
160
|
-
setDisableAutohide: function(value) {
|
|
161
|
-
this.settings.disableAutohide = value;
|
|
162
|
-
return this.element;
|
|
163
|
-
},
|
|
164
|
-
setShowOnUpscroll: function(value) {
|
|
165
|
-
this.settings.showOnUpscroll = value;
|
|
166
|
-
return this.element;
|
|
167
|
-
},
|
|
168
|
-
setShowOnBottom: function(value) {
|
|
169
|
-
this.settings.showOnBottom = value;
|
|
170
|
-
return this.element;
|
|
171
|
-
},
|
|
172
|
-
setHideOffset: function(value) {
|
|
173
|
-
this.settings.hideOffset = value;
|
|
174
|
-
return this.element;
|
|
175
|
-
},
|
|
176
|
-
setAnimationDuration: function(value) {
|
|
177
|
-
this.settings.animationDuration = value;
|
|
178
|
-
return this.element;
|
|
179
|
-
},
|
|
180
|
-
show: function() {
|
|
181
|
-
show(this);
|
|
182
|
-
return this.element;
|
|
183
|
-
},
|
|
184
|
-
hide: function() {
|
|
185
|
-
hide(this);
|
|
186
|
-
return this.element;
|
|
187
|
-
},
|
|
188
|
-
destroy: function() {
|
|
189
|
-
unbindEvents(this);
|
|
190
|
-
show(this);
|
|
191
|
-
$.data(this, 'plugin_' + pluginName, null);
|
|
192
|
-
return this.element;
|
|
193
|
-
}
|
|
194
|
-
};
|
|
195
|
-
|
|
196
|
-
$.fn[pluginName] = function(options) {
|
|
197
|
-
var args = arguments;
|
|
198
|
-
|
|
199
|
-
if (options === undefined || typeof options === 'object') {
|
|
200
|
-
return this.each(function() {
|
|
201
|
-
if (!$.data(this, 'plugin_' + pluginName)) {
|
|
202
|
-
$.data(this, 'plugin_' + pluginName, new AutoHidingNavbar(this, options));
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
|
206
|
-
var returns;
|
|
207
|
-
|
|
208
|
-
this.each(function() {
|
|
209
|
-
var instance = $.data(this, 'plugin_' + pluginName);
|
|
210
|
-
|
|
211
|
-
if (instance instanceof AutoHidingNavbar && typeof instance[options] === 'function') {
|
|
212
|
-
returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
|
|
213
|
-
}
|
|
214
|
-
});
|
|
215
|
-
|
|
216
|
-
return returns !== undefined ? returns : this;
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
};
|
|
220
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Bootstrap Auto-Hiding Navbar - v4.0.0
|
|
3
|
+
* An extension for Bootstrap's fixed navbar which hides the navbar while the page is scrolling downwards and shows it the other way. The plugin is able to show/hide the navbar programmatically as well.
|
|
4
|
+
* http://www.virtuosoft.eu/code/bootstrap-autohidingnavbar/
|
|
5
|
+
*
|
|
6
|
+
* Made by István Ujj-Mészáros
|
|
7
|
+
* Under Apache License v2.0 License
|
|
8
|
+
*/
|
|
9
|
+
;(function($, window, document, undefined) {
|
|
10
|
+
var pluginName = 'autoHidingNavbar',
|
|
11
|
+
$window = $(window),
|
|
12
|
+
$document = $(document),
|
|
13
|
+
_scrollThrottleTimer = null,
|
|
14
|
+
_resizeThrottleTimer = null,
|
|
15
|
+
_throttleDelay = 70,
|
|
16
|
+
_lastScrollHandlerRun = 0,
|
|
17
|
+
_previousScrollTop = null,
|
|
18
|
+
_windowHeight = $window.height(),
|
|
19
|
+
_visible = true,
|
|
20
|
+
_hideOffset,
|
|
21
|
+
defaults = {
|
|
22
|
+
disableAutohide: false,
|
|
23
|
+
showOnUpscroll: true,
|
|
24
|
+
showOnBottom: true,
|
|
25
|
+
hideOffset: 'auto', // "auto" means the navbar height
|
|
26
|
+
animationDuration: 200,
|
|
27
|
+
navbarOffset: 0
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
function AutoHidingNavbar(element, options) {
|
|
31
|
+
this.element = $(element);
|
|
32
|
+
this.settings = $.extend({}, defaults, options);
|
|
33
|
+
this._defaults = defaults;
|
|
34
|
+
this._name = pluginName;
|
|
35
|
+
this.init();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function hide(autoHidingNavbar) {
|
|
39
|
+
if (!_visible) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
autoHidingNavbar.element.addClass('navbar-hidden').animate({
|
|
44
|
+
top: -1 * parseInt(autoHidingNavbar.element.css('height'), 10) + autoHidingNavbar.settings.navbarOffset
|
|
45
|
+
}, {
|
|
46
|
+
queue: false,
|
|
47
|
+
duration: autoHidingNavbar.settings.animationDuration
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
$('.dropdown.open .dropdown-toggle, .dropdown.show .dropdown-toggle', autoHidingNavbar.element).dropdown('toggle');
|
|
52
|
+
}
|
|
53
|
+
catch(e) {}
|
|
54
|
+
|
|
55
|
+
_visible = false;
|
|
56
|
+
|
|
57
|
+
autoHidingNavbar.element.trigger('hide.autoHidingNavbar');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function show(autoHidingNavbar) {
|
|
61
|
+
if (_visible) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
autoHidingNavbar.element.removeClass('navbar-hidden').animate({
|
|
66
|
+
top: 0
|
|
67
|
+
}, {
|
|
68
|
+
queue: false,
|
|
69
|
+
duration: autoHidingNavbar.settings.animationDuration
|
|
70
|
+
});
|
|
71
|
+
_visible = true;
|
|
72
|
+
|
|
73
|
+
autoHidingNavbar.element.trigger('show.autoHidingNavbar');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function detectState(autoHidingNavbar) {
|
|
77
|
+
var scrollTop = $window.scrollTop(),
|
|
78
|
+
scrollDelta = scrollTop - _previousScrollTop;
|
|
79
|
+
|
|
80
|
+
_previousScrollTop = scrollTop;
|
|
81
|
+
|
|
82
|
+
if (scrollDelta < 0) {
|
|
83
|
+
if (_visible) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (autoHidingNavbar.settings.showOnUpscroll || scrollTop <= _hideOffset) {
|
|
88
|
+
show(autoHidingNavbar);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if (scrollDelta > 0) {
|
|
92
|
+
if (!_visible) {
|
|
93
|
+
if (autoHidingNavbar.settings.showOnBottom && scrollTop + _windowHeight === $document.height()) {
|
|
94
|
+
show(autoHidingNavbar);
|
|
95
|
+
}
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (scrollTop >= _hideOffset) {
|
|
100
|
+
hide(autoHidingNavbar);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function scrollHandler(autoHidingNavbar) {
|
|
107
|
+
if (autoHidingNavbar.settings.disableAutohide) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
_lastScrollHandlerRun = new Date().getTime();
|
|
112
|
+
|
|
113
|
+
detectState(autoHidingNavbar);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function bindEvents(autoHidingNavbar) {
|
|
117
|
+
$document.on('scroll.' + pluginName, function() {
|
|
118
|
+
if (new Date().getTime() - _lastScrollHandlerRun > _throttleDelay) {
|
|
119
|
+
scrollHandler(autoHidingNavbar);
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
clearTimeout(_scrollThrottleTimer);
|
|
123
|
+
_scrollThrottleTimer = setTimeout(function() {
|
|
124
|
+
scrollHandler(autoHidingNavbar);
|
|
125
|
+
}, _throttleDelay);
|
|
126
|
+
}
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
$window.on('resize.' + pluginName, function() {
|
|
130
|
+
clearTimeout(_resizeThrottleTimer);
|
|
131
|
+
_resizeThrottleTimer = setTimeout(function() {
|
|
132
|
+
_windowHeight = $window.height();
|
|
133
|
+
}, _throttleDelay);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
function unbindEvents() {
|
|
138
|
+
$document.off('.' + pluginName);
|
|
139
|
+
|
|
140
|
+
$window.off('.' + pluginName);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
AutoHidingNavbar.prototype = {
|
|
144
|
+
init: function() {
|
|
145
|
+
this.elements = {
|
|
146
|
+
navbar: this.element
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
this.setDisableAutohide(this.settings.disableAutohide);
|
|
150
|
+
this.setShowOnUpscroll(this.settings.showOnUpscroll);
|
|
151
|
+
this.setShowOnBottom(this.settings.showOnBottom);
|
|
152
|
+
this.setHideOffset(this.settings.hideOffset);
|
|
153
|
+
this.setAnimationDuration(this.settings.animationDuration);
|
|
154
|
+
|
|
155
|
+
_hideOffset = this.settings.hideOffset === 'auto' ? parseInt(this.element.css('height'), 10) : this.settings.hideOffset;
|
|
156
|
+
bindEvents(this);
|
|
157
|
+
|
|
158
|
+
return this.element;
|
|
159
|
+
},
|
|
160
|
+
setDisableAutohide: function(value) {
|
|
161
|
+
this.settings.disableAutohide = value;
|
|
162
|
+
return this.element;
|
|
163
|
+
},
|
|
164
|
+
setShowOnUpscroll: function(value) {
|
|
165
|
+
this.settings.showOnUpscroll = value;
|
|
166
|
+
return this.element;
|
|
167
|
+
},
|
|
168
|
+
setShowOnBottom: function(value) {
|
|
169
|
+
this.settings.showOnBottom = value;
|
|
170
|
+
return this.element;
|
|
171
|
+
},
|
|
172
|
+
setHideOffset: function(value) {
|
|
173
|
+
this.settings.hideOffset = value;
|
|
174
|
+
return this.element;
|
|
175
|
+
},
|
|
176
|
+
setAnimationDuration: function(value) {
|
|
177
|
+
this.settings.animationDuration = value;
|
|
178
|
+
return this.element;
|
|
179
|
+
},
|
|
180
|
+
show: function() {
|
|
181
|
+
show(this);
|
|
182
|
+
return this.element;
|
|
183
|
+
},
|
|
184
|
+
hide: function() {
|
|
185
|
+
hide(this);
|
|
186
|
+
return this.element;
|
|
187
|
+
},
|
|
188
|
+
destroy: function() {
|
|
189
|
+
unbindEvents(this);
|
|
190
|
+
show(this);
|
|
191
|
+
$.data(this, 'plugin_' + pluginName, null);
|
|
192
|
+
return this.element;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
$.fn[pluginName] = function(options) {
|
|
197
|
+
var args = arguments;
|
|
198
|
+
|
|
199
|
+
if (options === undefined || typeof options === 'object') {
|
|
200
|
+
return this.each(function() {
|
|
201
|
+
if (!$.data(this, 'plugin_' + pluginName)) {
|
|
202
|
+
$.data(this, 'plugin_' + pluginName, new AutoHidingNavbar(this, options));
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
} else if (typeof options === 'string' && options[0] !== '_' && options !== 'init') {
|
|
206
|
+
var returns;
|
|
207
|
+
|
|
208
|
+
this.each(function() {
|
|
209
|
+
var instance = $.data(this, 'plugin_' + pluginName);
|
|
210
|
+
|
|
211
|
+
if (instance instanceof AutoHidingNavbar && typeof instance[options] === 'function') {
|
|
212
|
+
returns = instance[options].apply(instance, Array.prototype.slice.call(args, 1));
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
return returns !== undefined ? returns : this;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
};
|
|
220
|
+
|
|
221
221
|
})(jQuery, window, document);
|