]> git.mdlowis.com Git - proto/kanban.git/commitdiff
updated based on feedback
authorMichael D. Lowis <mike.lowis@gentex.com>
Tue, 31 Jul 2018 13:23:29 +0000 (09:23 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Tue, 31 Jul 2018 13:23:29 +0000 (09:23 -0400)
index.html

index 101460643a99c8b0636152b0b7ea23e3b3aa0281..659fb9a2180a5302c3fc2f03e3e335684899df01 100644 (file)
@@ -58,23 +58,23 @@ h2 {
 }
 
 .dialog {
-    display: none; /* Hidden by default */
-    position: fixed; /* Stay in place */
-    z-index: 1; /* Sit on top */
+    display: none;
+    position: fixed;
+    z-index: 1;
     left: 0;
     top: 0;
-    width: 100%; /* Full width */
-    height: 100%; /* Full height */
-    overflow: auto; /* Enable scroll if needed */
-    background-color: rgb(0,0,0); /* Fallback color */
-    background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
+    width: 100%;
+    height: 100%;
+    overflow: auto;
+    background-color: rgb(0,0,0);
+    background-color: rgba(0,0,0,0.4);
 }
 
 .dialog-content {
     background: #fafafa;
-    margin: 15% auto; /* 15% from the top and centered */
+    margin: 15% auto;
     padding: 10px;
-    width: 80%; /* Could be more or less, depending on screen size */
+    width: 80%;
     overflow: hidden;
     position: relative;
     display: block;
@@ -92,6 +92,10 @@ h2 {
     color: #555;
 }
 
+.visible {
+    display: block;
+}
+
     </style>
 </head>
 <body>
@@ -147,6 +151,7 @@ h2 {
     </div>
 
     <script>
+'use strict';
 (() => {
     const drag_start = (ev) => {
         ev.target.id = "selected-card";
@@ -163,23 +168,23 @@ h2 {
         ev.preventDefault();
         const tgt = ev.target;
         const data = document.getElementById(ev.dataTransfer.getData("text"));
-        if (tgt.tagName == "H2") {
+        if (tgt.tagName === "H2") {
             tgt.parentNode.appendChild(data);
-        } else if (tgt.className == "card") {
+        } else if (tgt.classList.contains("card")) {
             tgt.parentNode.insertBefore(data, tgt);
         } else {
             tgt.appendChild(data);
         }
-        data.id = null;
+        data.id = "";
     }
 
     const dblclick = (ev) => {
-        dialog.style.display = "block";
+        dialog.classList.add("visible"); 
     }
 
     window.onclick = (ev) => {
-        if (ev.target == dialog) {
-            dialog.style.display = "none";
+        if (ev.target === dialog) {
+            dialog.classList.remove("visible"); 
         }
     }