CRM-17176 - More improvements to reports menu reset ui
authorColeman Watts <coleman@civicrm.org>
Thu, 15 Oct 2015 15:36:13 +0000 (11:36 -0400)
committerColeman Watts <coleman@civicrm.org>
Thu, 15 Oct 2015 15:36:13 +0000 (11:36 -0400)
templates/CRM/Admin/Page/Navigation.tpl

index 5f78177c56d12a411974f17031127dd427fd86da..7399bdeaccf5cdcc003445d8a6e237a9c2b0f10f 100644 (file)
     <div id="navigation-tree" class="navigation-tree" style="height:auto; border-collapse:separate; background-color:#FFFFFF;"></div>
     <div class="spacer"></div>
     <div>
-      {* TODO: fa-broom would be better, but not implemented yet. https://github.com/FortAwesome/Font-Awesome/issues/239 *}
-      <a href="#" class="nav-reset crm-hover-button"><i class="crm-i fa-undo"></i> {ts}Cleanup reports menu{/ts}</a>
+      <a href="#" class="nav-reset crm-hover-button">
+        {* TODO: fa-broom would be better, but not implemented yet. https://github.com/FortAwesome/Font-Awesome/issues/239 *}
+        <i class="crm-i fa-undo"></i> {ts}Cleanup reports menu{/ts}
+      </a>
     </div>
     <div class="spacer"></div>
   </div>
 
       $('a.nav-reset').on('click', function(e) {
         e.preventDefault();
-        CRM.confirm({message: '{/literal}{ts escape='js'}This will rebuild the "Reports" menu to include all currently active reports.{/ts}{literal}'})
-          .on('crmConfirm:yes', function () {
+        CRM.confirm({
+          title: $(this).text(),
+          message: '{/literal}{ts escape='js'}This will rebuild the "Reports" menu to include all currently active reports.{/ts}{literal}'
+        })
+          .on('crmConfirm:yes', function() {
+            $('#crm-container').block();
             CRM.api3('Navigation', 'reset', {'for': 'report'}, true)
               .done(function() {
+                $('#crm-container').unblock();
                 $("#navigation-tree").jstree('refresh');
                 $("#reset-menu").show();
               })