1 // http://civicrm.org/licensing
4 .on('dialogopen', function(e
) {
5 // Make admin bar hide behind popup windows
6 $('#adminmenuwrap').css('z-index', '100');
8 .on('dialogclose', function(e
) {
9 if ($('.ui-dialog-content:visible').not(e
.target
).length
< 1) {
10 // Restore admin bar position
11 $('#adminmenuwrap').css('z-index', '');
14 .on('crmWysiwygCreate', function(e
, type
, editor
) {
15 if (type
=== 'ckeditor') {
16 editor
.on('maximize', function(e
) {
17 $('#wpadminbar').toggle(e
.data
=== 2);
21 // Prevent screen reader shortcuts from changing the document hash and breaking angular routes
22 $('a.screen-reader-shortcut').click(function() {
23 var href
= $(this).attr('href');
24 // Show toolbar if hidden
25 if (href
=== '#wp-toolbar' && CRM
.menubar
.position
=== 'over-cms-menu') {
26 CRM
.menubar
.togglePosition(false);
31 $('<a href="#crm-qsearch-input" class="screen-reader-shortcut">' + ts("Open CiviCRM Menu") + '</a>')
32 .prependTo('#adminmenumain')
34 CRM
.menubar
.open('Home');