Эх сурвалжийг харах

\#69: Ausgelagert und CSS leicht angepasst um Abstand zwischen mehreren Boxen zu bekommen

Moritz Schmidt 10 жил өмнө
parent
commit
65a4a445c9
2 өөрчлөгдсөн 24 нэмэгдсэн , 24 устгасан
  1. 18 24
      scripts/custom.js
  2. 6 0
      styles/style.css

+ 18 - 24
scripts/custom.js

@@ -1,6 +1,17 @@
 $(document).ready(function() {
 
     var lastOpenedBoxData; // Stores JSON-data of last opened editBox
+    var notifications = []; // Stores noty-Notifications
+
+    function noty_error_retry() {
+        notifications.push(
+            noty({
+                layout  : 'topCenter',
+                text    : 'Irgendwas ist schief gelaufen.<br>Bitte probieren Sie es später noch einmal.',
+                type    : 'error',
+                timeout : 3000
+            }));
+    }
 
     function getUrlGetParameter(val) {
         var result = "Not found",
@@ -91,12 +102,7 @@ $(document).ready(function() {
                         });
                     } catch(e) {
                         console.log(e); // DBG
-                        var n = noty({
-                            layout  : 'topCenter',
-                            text    : 'Irgendwas ist schief gelaufen.<br>Bitte probieren Sie es später noch einmal.',
-                            type    : 'error',
-                            timeout : 5000
-                            });
+                        noty_error_retry();
                     }
                 });
 
@@ -149,12 +155,8 @@ $(document).ready(function() {
                 if(r['status'] == "OK") {
                     location.reload();
                 } else {
-                    var n = noty({
-                        layout  : 'topCenter',
-                        text    : 'Irgendwas ist schief gelaufen.<br>Bitte probieren Sie es später noch einmal.',
-                        type    : 'error',
-                        timeout : 5000
-                        });
+                    console.log(r);
+                    noty_error_retry();
                 }
             });
         });
@@ -174,12 +176,8 @@ $(document).ready(function() {
                 if(r['status'] == "OK") {
                     location.reload();
                 } else {
-                    var n = noty({
-                        layout  : 'topCenter',
-                        text    : 'Irgendwas ist schief gelaufen.<br>Bitte probieren Sie es später noch einmal.',
-                        type    : 'error',
-                        timeout : 5000
-                        });
+                    console.log(r);
+                    noty_error_retry();
                 }
             });
         });
@@ -200,12 +198,8 @@ $(document).ready(function() {
                     });
 
                 } else {
-                    var n = noty({
-                        layout  : 'topCenter',
-                        text    : 'Irgendwas ist schief gelaufen.<br>Bitte probieren Sie es später noch einmal.',
-                        type    : 'error',
-                        timeout : 5000
-                        });
+                    console.log(r);
+                    noty_error_retry();
                 }
             });
         });

+ 6 - 0
styles/style.css

@@ -66,6 +66,12 @@ table td {
 	float: right;
 }
 
+/* noty (custom) */
+
+#noty_topCenter_layout_container li {
+	margin-top: 5px;
+}
+
 
 /* Spinner (http://tobiasahlin.com/spinkit/) */