LEFT | RIGHT |
1 var hideElements = function() | 1 var hideElements = function() |
2 { | 2 { |
3 | |
4 // no need to invoke if already invoked on another event | 3 // no need to invoke if already invoked on another event |
5 if (jsBridge.isElementsHidden()) | 4 if ({{BRIDGE}}.isElementsHidden()) |
6 { | 5 { |
7 {{DEBUG}} console.log('already hidden, exiting'); | 6 {{DEBUG}} console.log('already hidden, exiting'); |
8 return; | 7 return; |
9 } | 8 } |
10 | 9 |
11 // hide using element visibility (to be replaced with script body) | 10 // hide using element visibility (to be replaced with script body) |
12 {{HIDE}} | 11 {{HIDE}} |
13 | 12 |
14 {{BRIDGE}}.setElementsHidden(true); // set flag not to do it again | 13 {{BRIDGE}}.setElementsHidden(true); // set flag not to do it again |
15 }; | 14 }; |
(...skipping 20 matching lines...) Expand all Loading... |
36 }); | 35 }); |
37 | 36 |
38 // DOMContentLoaded event | 37 // DOMContentLoaded event |
39 document.addEventListener('DOMContentLoaded', function() | 38 document.addEventListener('DOMContentLoaded', function() |
40 { | 39 { |
41 {{DEBUG}} console.log('DOMContentLoaded() event fired'); | 40 {{DEBUG}} console.log('DOMContentLoaded() event fired'); |
42 hideElements(); | 41 hideElements(); |
43 }, false); | 42 }, false); |
44 | 43 |
45 }; | 44 }; |
LEFT | RIGHT |