$el.parents(buttonContainers).css({height: 0, padding: 0, margin: 0, overflow: 'hidden'}).find('.crm-button-icon').hide();
});
$el.dialog('option', 'buttons', buttons);
-
- // Show done button for non-ajax dialogs (e.g. file downloads)
- $(this).on('submit', "form[data-no-ajax-submit=true]", function() {
- $el.dialog('option', 'buttons', [{
- text: ts('Done'),
- icons: {primary: 'ui-icon-close'},
- click: function() {$(this).dialog('close');}
- }]);
- });
}
// Allow a button to prevent ajax submit
$('input[data-no-ajax-submit=true]').click(function() {
});
// After the pdf downloads, the user has to manually close the dialog (which would be nice to fix)
// But at least we can trigger the underlying list of activities to refresh
- $form.closest('.ui-dialog-content.crm-ajax-container').on('dialogbeforeclose', function() {
- $(this).trigger('crmFormSuccess');
+ $('[name=_qf_PDF_submit]', $form).click(function() {
+ var $dialog = $(this).closest('.ui-dialog-content.crm-ajax-container');
+ if ($dialog.length) {
+ $dialog.on('dialogbeforeclose', function () {
+ $(this).trigger('crmFormSuccess');
+ });
+ $dialog.dialog('option', 'buttons', [{
+ text: {/literal}"{ts escape='js'}Done{/ts}"{literal},
+ icons: {primary: 'ui-icon-close'},
+ click: function() {$(this).dialog('close');}
+ }]);
+ }
});
showSaveDetails($('input[name=saveTemplate]', $form)[0]);