aboutsummaryrefslogtreecommitdiff
path: root/scripts/src/main-nav.js
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/src/main-nav.js')
-rw-r--r--scripts/src/main-nav.js45
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'));
+ });
+ }
}