X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.ajax.js;h=3ee5394097030ed6f75b0043d9036826edd986bb;hb=da8f0cf5b79bdf01e67fb96e5aa9120594ac5fc0;hp=fc7610cceff39938f2eea044bf0a0b1513c34ed4;hpb=fa92b4af1c4abf280689cea6445c7a9b99858831;p=civicrm-core.git diff --git a/js/crm.ajax.js b/js/crm.ajax.js index fc7610ccef..3ee5394097 100644 --- a/js/crm.ajax.js +++ b/js/crm.ajax.js @@ -373,7 +373,7 @@ validate: true, refreshAction: ['next_new', 'submit_savenext', 'upload_new'], cancelButton: '.cancel', - openInline: 'a.open-inline, a.button, a.action-item', + openInline: 'a.open-inline, a.button, a.action-item, a.open-inline-noreturn', onCancel: function(event) {} } }; @@ -487,6 +487,10 @@ if (settings.openInline) { settings.autoClose = $el.crmSnippet('isOriginalUrl'); $(settings.openInline, this).not(exclude + ', .crm-popup').click(function(event) { + if ($(this).hasClass('open-inline-noreturn')) { + // Force reset of original url + $el.data('civiCrmSnippet')._originalUrl = $(this).attr('href'); + } $el.crmSnippet('option', 'url', $(this).attr('href')).crmSnippet('refresh'); return false; }); @@ -508,14 +512,14 @@ if ($icon.length) { button.icons = {primary: $icon.attr('class')}; } else { - var action = $el.hasClass('cancel') ? 'close' : (identifier.substr(identifier.length-4) === '_new' ? 'plus' : 'check'); + var action = $el.attr('crm-icon') || ($el.hasClass('cancel') ? 'close' : 'check'); button.icons = {primary: 'ui-icon-' + action}; } buttons.push(button); added.push(identifier); } // display:none causes the form to not submit when pressing "enter" - $el.parents(buttonContainers).css({height: 0, padding: 0, margin: 0, overflow: 'hidden'}); + $el.parents(buttonContainers).css({height: 0, padding: 0, margin: 0, overflow: 'hidden'}).find('.crm-button-icon').hide(); }); $el.dialog('option', 'buttons', buttons); }