diff options
author | luxagraf <sng@luxagraf.net> | 2019-01-05 09:50:21 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2019-01-05 09:50:21 -0600 |
commit | d5f430d3e1e2b274d8d8f744251e8b6b4b72ebd9 (patch) | |
tree | 094404cdf4eaba53b1e225b54212679f6f032afd /scripts/src/main-nav.js | |
parent | 23b4b185e3f3f8b9f17eebc49110cb4696acdb39 (diff) |
changed to custom modal, added saving animation for note editing.
Diffstat (limited to 'scripts/src/main-nav.js')
-rw-r--r-- | scripts/src/main-nav.js | 45 |
1 files changed, 10 insertions, 35 deletions
diff --git a/scripts/src/main-nav.js b/scripts/src/main-nav.js index 0be7712..0dcd82b 100644 --- a/scripts/src/main-nav.js +++ b/scripts/src/main-nav.js @@ -46,40 +46,15 @@ if (document.getElementById('account-menu')) { }, false); } -//function buildNotebookMenu () { -// var data = JSON.parse(this.responseText); -// var div = document.getElementById("notebooks-menu"); -// var ul = document.createElement("ul"); -// ul.classList.add("vertical","list-style-none"); -// div.appendChild(ul); -// for(var i in data) { -// var li = document.createElement("li"); -// var a = document.createElement("a"); -// a.setAttribute("href", data[i]['json_absolute_url']); -// a.innerHTML = data[i]['name']; -// li.append(a); -// ul.append(li); -// } -// var li = document.createElement("li"); -// var a = document.createElement("a"); -// a.setAttribute("href", '/user/{{user.username}}/notebooks/'); -// a.innerHTML = "View all" -// li.append(a); -// ul.append(li); -//} -// -// -//// getJSON("{%url 'notebook-api-list' %}", buildNotebookMenu); -// - -if (typeof(document.getElementById('js-overlay-content')) != 'undefined' && document.getElementById('js-overlay-content') != null) { +if (typeof(document.getElementById('js-overlay-login')) != 'undefined' && document.getElementById('js-overlay-login') != null) { // Select your overlay trigger - var trigger = document.querySelector('#overlay-trigger'); - trigger.addEventListener('click', function(e){ - e.preventDefault(); - novicell.overlay.create({ - 'selector': trigger.getAttribute('data-element'), - 'class': 'selector-overlay', - }); - }); + var trigger = document.getElementById('overlay-trigger'); + addLoginHandler(trigger); + function addLoginHandler(el){ + console.log(el); + el.addEventListener('click', function(e){ + e.preventDefault(); + var modal = modalBox(el, document.getElementById('js-overlay-login')); + }); + } } |