Commit | Line | Data |
---|---|---|
469d8dab CW |
1 | // http://civicrm.org/licensing |
2 | CRM.$(function($) { | |
3 | $(document) | |
a1f06c87 CW |
4 | .on('crmWysiwygCreate', function(e, type, editor) { |
5 | if (type === 'ckeditor') { | |
6 | editor.on('maximize', function(e) { | |
7 | $('#wpadminbar').toggle(e.data === 2); | |
8 | }); | |
9 | } | |
469d8dab | 10 | }); |
b30809e4 CW |
11 | // Prevent screen reader shortcuts from changing the document hash and breaking angular routes |
12 | $('a.screen-reader-shortcut').click(function() { | |
44d369d5 | 13 | var target = $(this).attr('href'); |
b30809e4 | 14 | // Show toolbar if hidden |
44d369d5 | 15 | if (target === '#wp-toolbar' && CRM.menubar.position === 'over-cms-menu') { |
b30809e4 CW |
16 | CRM.menubar.togglePosition(false); |
17 | } | |
44d369d5 | 18 | $(target).focus(); |
b30809e4 CW |
19 | return false; |
20 | }); | |
21 | $('<a href="#crm-qsearch-input" class="screen-reader-shortcut">' + ts("Open CiviCRM Menu") + '</a>') | |
22 | .prependTo('#adminmenumain') | |
23 | .click(function() { | |
24 | CRM.menubar.open('Home'); | |
25 | return false; | |
26 | }); | |
469d8dab | 27 | }); |