]> git.ipfire.org Git - thirdparty/bulma.git/commitdiff
Remove book modal
authorJeremy Thomas <bbxdesign@gmail.com>
Sun, 8 Apr 2018 18:54:36 +0000 (19:54 +0100)
committerJeremy Thomas <bbxdesign@gmail.com>
Sun, 8 Apr 2018 19:15:06 +0000 (20:15 +0100)
docs/_javascript/main.js
docs/lib/main.js

index abfcfc2fbe6704839caba7297b4a8942316fe149..431b55cbc4fe34c58007edee11e6c0efbb0ca08d 100644 (file)
@@ -7,23 +7,23 @@ document.addEventListener('DOMContentLoaded', () => {
 
   // Book modal
 
-  const $bookModal = document.getElementById('bookModal');
-  const $bookModalCloseButtons = getAll('.bd-book-modal-close');
-
-  if (!cookieBookModal) {
-    setTimeout(() => {
-      openModal('bookModal');
-    }, 5000);
-  }
-
-  if ($bookModalCloseButtons.length > 0) {
-    $bookModalCloseButtons.forEach($el => {
-      $el.addEventListener('click', event => {
-        event.stopPropagation();
-        Cookies.set(cookieBookModalName, true, { expires: 30 });
-      });
-    });
-  }
+  // const $bookModal = document.getElementById('bookModal');
+  // const $bookModalCloseButtons = getAll('.bd-book-modal-close');
+
+  // if (!cookieBookModal) {
+  //   setTimeout(() => {
+  //     openModal('bookModal');
+  //   }, 5000);
+  // }
+
+  // if ($bookModalCloseButtons.length > 0) {
+  //   $bookModalCloseButtons.forEach($el => {
+  //     $el.addEventListener('click', event => {
+  //       event.stopPropagation();
+  //       Cookies.set(cookieBookModalName, true, { expires: 30 });
+  //     });
+  //   });
+  // }
 
   // Meta links
 
@@ -117,6 +117,14 @@ document.addEventListener('DOMContentLoaded', () => {
     });
   }
 
+  document.addEventListener('keydown', event => {
+    const e = event || window.event;
+    if (e.keyCode === 27) {
+      closeModals();
+      closeDropdowns();
+    }
+  });
+
   // Clipboard
 
   const $highlights = getAll('.highlight');
index 179df621a7f22a114033ecc9f770a26068ded29d..bfca74263cac164e9e8cdfe0ebd9e74bf8d5b999 100644 (file)
@@ -9,23 +9,23 @@ document.addEventListener('DOMContentLoaded', function () {
 
   // Book modal
 
-  var $bookModal = document.getElementById('bookModal');
-  var $bookModalCloseButtons = getAll('.bd-book-modal-close');
-
-  if (!cookieBookModal) {
-    setTimeout(function () {
-      openModal('bookModal');
-    }, 5000);
-  }
-
-  if ($bookModalCloseButtons.length > 0) {
-    $bookModalCloseButtons.forEach(function ($el) {
-      $el.addEventListener('click', function (event) {
-        event.stopPropagation();
-        Cookies.set(cookieBookModalName, true, { expires: 30 });
-      });
-    });
-  }
+  // const $bookModal = document.getElementById('bookModal');
+  // const $bookModalCloseButtons = getAll('.bd-book-modal-close');
+
+  // if (!cookieBookModal) {
+  //   setTimeout(() => {
+  //     openModal('bookModal');
+  //   }, 5000);
+  // }
+
+  // if ($bookModalCloseButtons.length > 0) {
+  //   $bookModalCloseButtons.forEach($el => {
+  //     $el.addEventListener('click', event => {
+  //       event.stopPropagation();
+  //       Cookies.set(cookieBookModalName, true, { expires: 30 });
+  //     });
+  //   });
+  // }
 
   // Meta links
 
@@ -119,6 +119,14 @@ document.addEventListener('DOMContentLoaded', function () {
     });
   }
 
+  document.addEventListener('keydown', function (event) {
+    var e = event || window.event;
+    if (e.keyCode === 27) {
+      closeModals();
+      closeDropdowns();
+    }
+  });
+
   // Clipboard
 
   var $highlights = getAll('.highlight');