CRM-14690 - Target correct button for undo action
authorColeman Watts <coleman@civicrm.org>
Mon, 9 Jun 2014 13:51:00 +0000 (14:51 +0100)
committerColeman Watts <coleman@civicrm.org>
Mon, 9 Jun 2014 13:51:00 +0000 (14:51 +0100)
js/crm.ajax.js

index 2968acb30829ff32b3e79983cde8f756ba9a9b42..0fd7f4b3031b907e93022e1bf86793f39279b7fa 100644 (file)
     }
     if (widget.data('uiDialog')) {
       // This is a bit harsh but we are removing jQuery UI's event handler from the close button and adding our own
-      $('.ui-dialog-titlebar-close').first().off().click(cancelAction);
+      widget.parent().find('.ui-dialog-titlebar-close').first().off().click(cancelAction);
     }
 
     widget.on('crmFormLoad.crmForm', function(event, data) {