X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=js%2Fcrm.wordpress.js;h=81b433e65f19169439085017bfd25846d5e71ca3;hb=1c61351180d7e9b40113df5827a479de467fdbc2;hp=e9667e6d1223095ff300ccbc4a4d2612ae869366;hpb=7eed4524498d0335c66c8c8cedbe1887aa65ac6f;p=civicrm-core.git diff --git a/js/crm.wordpress.js b/js/crm.wordpress.js index e9667e6d12..81b433e65f 100644 --- a/js/crm.wordpress.js +++ b/js/crm.wordpress.js @@ -1,24 +1,27 @@ // http://civicrm.org/licensing CRM.$(function($) { $(document) - .on('dialogopen', function(e) { - // Make admin bar hide behind popup windows - $('#adminmenuwrap').css('z-index', '100'); - }) - .on('dialogclose', function(e) { - if ($('.ui-dialog-content:visible').not(e.target).length < 1) { - // 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); }); } - }) - .ready(function() { - $('#civicrm-menu').css({position: "fixed", top: "0px"}); + }); + // Prevent screen reader shortcuts from changing the document hash and breaking angular routes + $('a.screen-reader-shortcut').click(function() { + var target = $(this).attr('href'); + // Show toolbar if hidden + if (target === '#wp-toolbar' && CRM.menubar.position === 'over-cms-menu') { + CRM.menubar.togglePosition(false); + } + $(target).focus(); + return false; }); + $('' + ts("Open CiviCRM Menu") + '') + .prependTo('#adminmenumain') + .click(function() { + CRM.menubar.open('Home'); + return false; + }); });