Explorar el Código

Prevent default event for the removeContact link in order to avoid page reload when jQuery Dialog is openened from clicking on the delete link

ichim-david hace 12 años
padre
commit
19caf7c448
Se han modificado 1 ficheros con 3 adiciones y 2 borrados
  1. 3 2
      converse.js

+ 3 - 2
converse.js

@@ -1240,7 +1240,7 @@
             ev.preventDefault();
             ev.preventDefault();
         },
         },
 
 
-        removeContact: function () {
+        removeContact: function (ev) {
             var that = this;
             var that = this;
             $("<span></span>").dialog({
             $("<span></span>").dialog({
                 title: 'Are you sure you want to remove this contact?',
                 title: 'Are you sure you want to remove this contact?',
@@ -1272,6 +1272,7 @@
                     }
                     }
                 }
                 }
             });
             });
+            ev.preventDefault();
         },
         },
 
 
         acceptRequest: function (ev) {
         acceptRequest: function (ev) {
@@ -1669,7 +1670,7 @@
             }
             }
             // Hide the headings if there are no contacts under them
             // Hide the headings if there are no contacts under them
             _.each([$my_contacts, $contact_requests, $pending_contacts], function (h) {
             _.each([$my_contacts, $contact_requests, $pending_contacts], function (h) {
-                if (h.nextUntil('dt').length && !h.is('visible')) {
+                if (h.nextUntil('dt').length && !h.is(':visible')) {
                     h.show();
                     h.show();
                 }
                 }
             });
             });