From: Coleman Watts Date: Thu, 2 Oct 2014 18:34:20 +0000 (-0400) Subject: CRM-15412 - Fix CRM.confirm to add content before opening dialog X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c0b7c8157f8510e684dda4998337997a592d25d2;p=civicrm-core.git CRM-15412 - Fix CRM.confirm to add content before opening dialog --- diff --git a/js/Common.js b/js/Common.js index 516acdc9bb..4480978a87 100644 --- a/js/Common.js +++ b/js/Common.js @@ -808,19 +808,19 @@ CRM.strings = CRM.strings || {}; settings.buttons = _.sortBy(buttons, 'data-op').reverse(); } url = settings.url; - msg = settings.message; + msg = url ? '' : settings.message; delete settings.options; delete settings.message; delete settings.url; - dialog = $('
').dialog(settings); + dialog = $('
').html(msg || '').dialog(settings); if ($.isFunction(options)) { dialog.on('crmConfirm:yes', options); } if (url) { CRM.loadPage(url, {target: dialog}); } - else if (msg && msg.length) { - dialog.html(msg).trigger('crmLoad'); + else { + dialog.trigger('crmLoad'); } return dialog; };