Browse Source

PG - fixed bug on select

Temechon 8 years ago
parent
commit
78c0e4001a
1 changed files with 22 additions and 22 deletions
  1. 22 22
      Playground/js/actions.js

+ 22 - 22
Playground/js/actions.js

@@ -51,34 +51,34 @@
             e.stopPropagation();
         }
         s.addEventListener('click', displayItems);
+    }
 
-        // Handle mouseover on subSelect
-        var allSubItems = document.querySelectorAll('.toDisplaySub');
-        var removeAllSubItems = function () {
-            for (var index = 0; index < allSubItems.length; index++) {
-                var tds = allSubItems[index];
-                if (tds.style.display == 'block') {
-                    tds.style.display = 'none';
-                }
+    // Handle mouseover on subSelect
+    var allSubItems = document.querySelectorAll('.toDisplaySub');
+    var removeAllSubItems = function () {
+        for (var index = 0; index < allSubItems.length; index++) {
+            var tds = allSubItems[index];
+            if (tds.style.display == 'block') {
+                tds.style.display = 'none';
             }
         }
+    }
 
-        var allSubSelect = document.querySelectorAll('.subSelect');
-        for (var index = 0; index < allSubSelect.length; index++) {
-            var ss = allSubSelect[index];
-            ss.addEventListener('mouseenter', function () {
-                var toDisplay = this.querySelector('.toDisplaySub');
-                if (toDisplay) {
-                    if (toDisplay.style.display == 'block') {
-                        toDisplay.style.display = 'none';
-                    } else {
-                        removeAllSubItems();
-                        toDisplay.style.display = 'block';
-                    }
+    var allSubSelect = document.querySelectorAll('.subSelect');
+    for (var index = 0; index < allSubSelect.length; index++) {
+        var ss = allSubSelect[index];
+        ss.addEventListener('mouseenter', function () {
+            var toDisplay = this.querySelector('.toDisplaySub');
+            if (toDisplay) {
+                if (toDisplay.style.display == 'block') {
+                    toDisplay.style.display = 'none';
+                } else {
+                    removeAllSubItems();
+                    toDisplay.style.display = 'block';
                 }
-            })
+            }
+        })
 
-        }
     }
 
     document.querySelector('#safemodeToggle').addEventListener('click', function () {