forked from zombieFox/nightTab
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayout.js
More file actions
42 lines (37 loc) · 838 Bytes
/
Copy pathlayout.js
File metadata and controls
42 lines (37 loc) · 838 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
33
34
35
36
37
38
39
40
41
42
var layout = (function() {
var render = function() {
var html = helper.e("html");
html.style.setProperty("--layout-width", "calc(" + helper.getObject({
object: state.get(),
path: "layout.width"
}) + "vw - var(--layout-width-gutter))");
};
var edge = function(action) {
var body = helper.e("body");
var container = helper.makeNode({
tag: "div",
attr: [{
key: "class",
value: "container container-edge"
}]
});
var state = {
show: function() {
body.appendChild(container);
},
hide: function() {
body.removeChild(helper.e(".container-edge"));
}
};
state[action]();
};
var init = function() {
render();
};
// exposed methods
return {
edge: edge,
render: render,
init: init
};
})();