Merge pull request #22099 from civicrm/5.44
[civicrm-core.git] / js / crm.drupal7.js
1 // https://civicrm.org/licensing
2 (function($) {
3 "use strict";
4
5 $(document).on('crmLoad', '#civicrm-menu', hideMenuToggleButtonForNonAdminUsers);
6
7 /**
8 * Hides the Menu Toggle Button when the Admin Menu is not available for the user.
9 */
10 function hideMenuToggleButtonForNonAdminUsers() {
11 $(document).ready(function() {
12 if (!$('#toolbar').length) {
13 CRM.menubar.removeToggleButton();
14 }
15 });
16 }
17
18 })(CRM.$);