| 1 | // http://civicrm.org/licensing |
| 2 | CRM.$(function($) { |
| 3 | $(document) |
| 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 | } |
| 10 | }); |
| 11 | // Prevent screen reader shortcuts from changing the document hash and breaking angular routes |
| 12 | $('a.screen-reader-shortcut').click(function() { |
| 13 | var target = $(this).attr('href'); |
| 14 | // Show toolbar if hidden |
| 15 | if (target === '#wp-toolbar' && CRM.menubar.position === 'over-cms-menu') { |
| 16 | CRM.menubar.togglePosition(false); |
| 17 | } |
| 18 | $(target).focus(); |
| 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 | }); |
| 27 | }); |