Commit | Line | Data |
---|---|---|
ab77d9df | 1 | // https://civicrm.org/licensing |
8f939417 | 2 | (function($) { |
ab77d9df | 3 | "use strict"; |
8f939417 | 4 | |
ab77d9df | 5 | $(document).on('crmLoad', '#civicrm-menu', hideMenuToggleButtonForNonAdminUsers); |
8f939417 RO |
6 | |
7 | /** | |
8 | * Hides the Menu Toggle Button when the Admin Menu is not available for the user. | |
8f939417 RO |
9 | */ |
10 | function hideMenuToggleButtonForNonAdminUsers() { | |
ab77d9df CW |
11 | $(document).ready(function() { |
12 | if (!$('#toolbar').length) { | |
13 | CRM.menubar.removeToggleButton(); | |
14 | } | |
15 | }); | |
8f939417 | 16 | } |
ab77d9df | 17 | |
8f939417 | 18 | })(CRM.$); |