diff options
author | jnew-gh <github@hazelden.ca> | 2021-04-18 22:40:06 +0300 |
---|---|---|
committer | jnew-gh <github@hazelden.ca> | 2021-04-18 22:40:06 +0300 |
commit | 569a8b1525e2e4c8ac264fe269f697083707360d (patch) | |
tree | f7ca7143ae0b2957e1095036a05e92a31cbbf5be /dmarcts-report-viewer.js | |
parent | e2db95a5f9544640c3871fba6b81f99306c740b4 (diff) |
Add Dropdown menu for options
All css styling, variables and functions to add a dropdown menu for options
Diffstat (limited to 'dmarcts-report-viewer.js')
-rw-r--r-- | dmarcts-report-viewer.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/dmarcts-report-viewer.js b/dmarcts-report-viewer.js index 35b3981..662d232 100644 --- a/dmarcts-report-viewer.js +++ b/dmarcts-report-viewer.js @@ -126,6 +126,33 @@ function showReportlist(str) { // str is the name of the <div> to be filled xhttp.send(); } +function showMenu() { + + document.getElementById('menu').style.display = 'block'; + document.getElementById('screen_overlay').style.display = 'block'; +} + +function hideMenu() { + + document.getElementById('menu').style.display = 'none'; + document.getElementById('screen_overlay').style.display = 'none'; +} + +function optionMenu(_element) { + + var _div = document.getElementById('menu'); + var input = _element.getBoundingClientRect(); + + _div.style.right = window.innerWidth - input.right + 'px'; + _div.style.top = document.getElementById('optionblock').bottom + 'px'; + + if ( document.getElementById('menu').style.display == 'none' || document.getElementById('menu').style.display == '' ) { + showMenu(); + } else { + hideMenu(); + } +} + function set_title(domain) { domain == 'all' ? document.getElementById('title').innerText = "DMARC Reports" : document.getElementById('title').innerText = "DMARC Reports for " + domain; |