forked from zombieFox/nightTab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpage.js
More file actions
32 lines (27 loc) · 693 Bytes
/
Copy pathpage.js
File metadata and controls
32 lines (27 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
var page = (function() {
var update = function() {
var body = helper.e("body");
var menu = state.get().menu;
var modal = state.get().modal;
var autoSuggest = state.get().autoSuggest;
if (menu || modal || autoSuggest) {
helper.addClass(body, "scroll-disabled");
} else {
helper.removeClass(body, "scroll-disabled");
};
};
var lock = function() {
var body = helper.e("body");
helper.addClass(body, "scroll-disabled");
};
var unlock = function() {
var body = helper.e("body");
helper.removeClass(body, "scroll-disabled");
};
// exposed methods
return {
lock: lock,
unlock: unlock,
update: update
};
})();