Browse Source

Fix bug where clicking close on msg alert didn't remove progress bar

master
Skylar Ittner 1 year ago
parent
commit
2f9eccf931
1 changed files with 6 additions and 7 deletions
  1. 6
    7
      static/js/app.js

+ 6
- 7
static/js/app.js View File

@@ -3,9 +3,8 @@
3 3
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4 4
 
5 5
 $(document).ready(function () {
6
-    /* Fade out alerts */
7
-    $(".alert .close").click(function (e) {
8
-        $(this).parent().fadeOut("slow");
6
+    $("#msg-alert-box").on("click", ".close", function (e) {
7
+        $("#msg-alert-box").fadeOut("slow");
9 8
     });
10 9
 
11 10
     if ($("#msg-alert-box").length) {
@@ -41,15 +40,15 @@ $(document).ready(function () {
41 40
             }
42 41
 
43 42
             if (msginteractiontick < fifty) {
44
-                $("#msg-alert-box .alert").css("opacity", "1");
43
+                $("#msg-alert-box").css("opacity", "1");
45 44
             }
46 45
             if (msginteractiontick == fifty) {
47
-                $("#msg-alert-box .alert").fadeTo(1000, 0.5);
46
+                $("#msg-alert-box").fadeTo(1000, 0.5);
48 47
             }
49 48
             if (msginteractiontick >= gone) {
50 49
                 setTimeout(function () {
51 50
                     if (msginteractiontick >= gone) {
52
-                        $("#msg-alert-box .alert").fadeOut("slow");
51
+                        $("#msg-alert-box").fadeOut("slow");
53 52
                         window.clearInterval(msgticker);
54 53
                     }
55 54
                 }, 1000);
@@ -57,7 +56,7 @@ $(document).ready(function () {
57 56
         }, 1000 * 1);
58 57
 
59 58
         $("#msg-alert-box").on("mouseenter", function () {
60
-            $("#msg-alert-box .alert").css("opacity", "1");
59
+            $("#msg-alert-box").css("opacity", "1");
61 60
             msginteractiontick = 0;
62 61
             console.log("👈😎👈 zoop");
63 62
         });

Loading…
Cancel
Save