Popups - error checking on event listner
authorColeman Watts <coleman@civicrm.org>
Thu, 6 Mar 2014 21:35:47 +0000 (16:35 -0500)
committerColeman Watts <coleman@civicrm.org>
Thu, 6 Mar 2014 21:35:47 +0000 (16:35 -0500)
js/Common.js

index 93448f3eff48da1a0a913be804b5a67d5165229b..dd770fee539337c842f28722c18f977d16735625 100644 (file)
@@ -902,8 +902,10 @@ CRM.validate = CRM.validate || {
       $('<div id="'+ settings.target.substring(1) +'"><div class="crm-loading-element">' + ts('Loading') + '...</div></div>').dialog(settings.dialog);
     }
     if (settings.dialog && !settings.dialog.title) {
-      $(settings.target).on('crmLoad', function(event, data) {
-        data.title && $(this).dialog('option', 'title', data.title);
+      $(settings.target).on('crmLoad', function(e, data) {
+        if (e.target === $(settings.target)[0] && data && data.title) {
+          $(this).dialog('option', 'title', data.title);
+        }
       });
     }
     $(settings.target).crmSnippet(settings).crmSnippet('refresh');