X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.wordpress.js;h=740b2246500cbf68979d4dad16a13103383678c0;hb=1fd00049e69653227b53343bbc2976a3132f3b97;hp=6ca4ff504d08ef3addffbd8679c7f40c422d3c13;hpb=f9c505543e6e06508b9567e1d04f439e16d6642f;p=civicrm-core.git diff --git a/js/crm.wordpress.js b/js/crm.wordpress.js index 6ca4ff504d..740b224650 100644 --- a/js/crm.wordpress.js +++ b/js/crm.wordpress.js @@ -10,5 +10,28 @@ CRM.$(function($) { // Restore admin bar position $('#adminmenuwrap').css('z-index', ''); } + }) + .on('crmWysiwygCreate', function(e, type, editor) { + if (type === 'ckeditor') { + editor.on('maximize', function(e) { + $('#wpadminbar').toggle(e.data === 2); + }); + } + }); + // Prevent screen reader shortcuts from changing the document hash and breaking angular routes + $('a.screen-reader-shortcut').click(function() { + var href = $(this).attr('href'); + // Show toolbar if hidden + if (href === '#wp-toolbar' && CRM.menubar.position === 'over-cms-menu') { + CRM.menubar.togglePosition(false); + } + $(href).focus(); + return false; + }); + $('' + ts("Open CiviCRM Menu") + '') + .prependTo('#adminmenumain') + .click(function() { + CRM.menubar.open('Home'); + return false; }); });