@@ -10,10 +10,10 @@ The CiviCRM page request lifecycle has always been closely coupled with traditio
Handler for a jQuery event e.g. `$('a').click(CRM.popup);`
!!!note Automatic via CSS Class
Note: often you do not need to write javascript at all to use this function. CiviCRM will automatically call it when any `<a>` with class `crm-popup` is clicked.
!!!note "Automatic via CSS Class"
Often you do not need to write javascript at all to use this function. CiviCRM will automatically call it when any `<a>` with class `crm-popup` is clicked.
This function invokes the entire ajax stack (`jQuery dialog`, `crmSnippet`, `jquery.forms`, and `jquery.validate`) by calling `CRM.loadForm` and `CRM.refreshParent` when appropriate.
This function invokes the entire ajax stack (`jQuery dialog`, `crmSnippet`, `jquery.forms`, and `jquery.validate`) by calling `CRM.loadForm` and `CRM.refreshParent` when appropriate.
#### Options
...
...
@@ -24,8 +24,8 @@ Default options can be overridden by adding to the markup of the triggering elem
#### Events
!!!note Event Buffering
This function buffers `crmFormSuccess` type events and then triggers `crmPopupFormSuccess` once when the dialog is closed. This prevents the underlying content from being needlessly refreshed more than once if multiple save operations are performed in the popup.
!!!note "Event Buffering"
This function buffers `crmFormSuccess` type events and then triggers `crmPopupFormSuccess` once when the dialog is closed. This prevents the underlying content from being needlessly refreshed more than once if multiple save operations are performed in the popup.
The following events will be triggered on the `<a>` element which initiated the popup (see CRM.loadForm below for events triggered on the popup itself):
...
...
@@ -35,7 +35,7 @@ The following events will be triggered on the `<a>` element which initiated the
### CRM.refreshParent
An event callback for CRM.popup or a standalone function to refresh the content around a given element.
An event callback for `CRM.popup` or a standalone function to refresh the content around a given element.
This function is automatically called for any `<a class="crm-popup">` after `crmPopupFormSuccess`, and can also be used to refresh any section of the page.
...
...
@@ -51,11 +51,17 @@ The following js functions have been added to facilitate ajax page/form requests
#### $().crmSnippet
This is implemented as a [jQuery UI Widget](http://api.jqueryui.com/jQuery.widget). It should be called on a jquery object like `$('.my-div').crmSnippet({url: CRM.url('civicrm/participant/view', '{reset: 1}')});`
This is implemented as a [jQuery UI Widget](http://api.jqueryui.com/jQuery.widget). It should be called on a jquery object as follows: