Quellcode durchsuchen

\#49: Status kann jetzt neu geladen werden

Moritz Schmidt vor 10 Jahren
Ursprung
Commit
6d08a66b55
2 geänderte Dateien mit 14 neuen und 2 gelöschten Zeilen
  1. 12 0
      scripts/custom.js
  2. 2 2
      templates/settings.php

+ 12 - 0
scripts/custom.js

@@ -91,6 +91,9 @@ $(document).ready(function() {
             var thisTr = this;
 
             if(this.attributes.length > 0) {
+                if($(this).children("td:first").children().length > 0) {
+                    $(this).children("td:first").children().remove();
+                }
                 addSpinner($(this).children("td:first"));
                 $.getJSON("ajax.php?action=getMailboxStatus&mailboxId=" + $(this).attr("data-mailbox-id"), function(r) {
                     if(r['connected'] == true) {
@@ -105,6 +108,14 @@ $(document).ready(function() {
         });
     }
 
+    function settingsListener() {
+        $(document).on("click", "#refresh-mailaccounts", function(e) {
+            e.preventDefault();
+            getMailboxStatus();
+
+        });
+    }
+
     function newDocumentListener() {
         $(document).on("change", ".fancybox-inner select", function(e) {
             reloadDraftVars();
@@ -352,6 +363,7 @@ $(document).ready(function() {
     switch(getUrlGetParameter("action")) {
         case 'settings':
             getMailboxStatus();
+            settingsListener();
             break;
         case 'manage-label':
             loadBox('.manage-mailboxfolder', function() {});

+ 2 - 2
templates/settings.php

@@ -38,8 +38,7 @@
             }
             ?>
             <tr>
-                <td><a id="add-mailaccount" href="#" data-uid="<?php echo $user->getUserId(); ?>"><i class="fa fa-plus-circle"></i></a></td>
-                <td></td>
+                <td><a id="refresh-mailaccounts" href="#"><i class="fa fa-refresh"></i></a></td>
                 <td></td>
                 <td></td>
                 <td></td>
@@ -47,6 +46,7 @@
                 <td></td>
                 <td></td>
                 <td></td>
+                <td><a id="add-mailaccount" href="#" data-uid="<?php echo $user->getUserId(); ?>"><i class="fa fa-plus-circle"></i></a></td>
             </tr>
         </table>
     </div>