CRM-20304 Tweak open-inline classes
authorColeman Watts <coleman@civicrm.org>
Mon, 9 Oct 2017 03:42:15 +0000 (23:42 -0400)
committerColeman Watts <coleman@civicrm.org>
Mon, 9 Oct 2017 03:42:15 +0000 (23:42 -0400)
open-inline implies that it will not pop up, so this explicitly excludes them.
This allows us to fix the problem where clicking the sort button would add to the history of the popup and take you "back" when clicking done instead of simply closing the dialog.

js/crm.ajax.js
templates/CRM/Custom/Page/Option.tpl

index 5f299a1c815eccc3e2b116e456e0d0baffc83774..9cb5eb601e0985c32784f8fa7724f2657be552b4 100644 (file)
       settings = $el.data('popup-settings') || {},
       formData = false;
     settings.dialog = settings.dialog || {};
-    if (e.isDefaultPrevented() || !CRM.config.ajaxPopupsEnabled || !url || $el.is(exclude + ', .no-open')) {
+    if (e.isDefaultPrevented() || !CRM.config.ajaxPopupsEnabled || !url || $el.is(exclude + ', .open-inline, .open-inline-noreturn')) {
       return;
     }
     // Sized based on css class
index a1b0a7c49eea133a9fc2a3dd79c0186fb34ee97a..6ccc8a6206018c6e28f374f7e39fba336215ed8a 100644 (file)
       {/literal}
 
       <div class="action-link">
-          {crmButton q="reset=1&action=map&fid=$fid&gid=$gid" class="action-item no-open" icon="sort-alpha-asc"}{ts}Alphabetize Options{/ts}{/crmButton}
+          {crmButton q="reset=1&action=map&fid=$fid&gid=$gid" class="action-item open-inline-noreturn" icon="sort-alpha-asc"}{ts}Alphabetize Options{/ts}{/crmButton}
           {crmButton q="reset=1&action=add&fid=$fid&gid=$gid" class="action-item" icon="plus-circle"}{ts}Add Option{/ts}{/crmButton}
           {crmButton p="civicrm/admin/custom/group/field" q="reset=1&action=browse&gid=$gid" class="action-item cancel" icon="times"}{ts}Done{/ts}{/crmButton}
       </div>