CRM-10693 - crmSnippet - JS tweaks.
authorColeman Watts <coleman@civicrm.org>
Thu, 28 Nov 2013 23:24:57 +0000 (15:24 -0800)
committerColeman Watts <coleman@civicrm.org>
Thu, 28 Nov 2013 23:24:57 +0000 (15:24 -0800)
js/Common.js

index a3e0b5a3437e23eb8eeff175ddf3e79b5c219561..68fdb87bdbdd820fa33df76d912bbc238b0ed28b 100644 (file)
@@ -822,16 +822,16 @@ CRM.validate = CRM.validate || {
 
   $.widget('civicrm.crmSnippet', {
     options: {
-      url: document.location.href,
+      url: null,
       block: true,
       crmForm: null
     },
     _create: function() {
-      this.refresh();
       this.element.addClass('crm-ajax-container');
       if (!this.element.is('.crm-container *')) {
         this.element.addClass('crm-container');
       }
+      this.options.url ? this.refresh() : this.options.url = document.location.href;
     },
     _onFailure: function(data) {
       this.options.block && this.element.unblock();
@@ -889,18 +889,6 @@ CRM.validate = CRM.validate || {
         data.title && $(this).dialog('option', 'title', data.title);
       });
     }
-    // Automatically open form links as new popups
-    settings.formLinks && $(settings.target).on('click', settings.formLinks, function() {
-      CRM.loadForm(this.href, {
-        dialog: {
-          width: '60%',
-          height: parseInt($(window).height() * .8)
-        }
-      }).on('crmFormSuccess', function() {
-          $(settings.target).crmSnippet('refresh');
-        });
-      return false;
-    });
     return $(settings.target).crmSnippet(settings);
   };