forked from civicrm/civicrm-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrm.wordpress.js
27 lines (27 loc) · 891 Bytes
/
crm.wordpress.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// http://civicrm.org/licensing
CRM.$(function($) {
$(document)
.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 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;
});
$('<a href="#crm-qsearch-input" class="screen-reader-shortcut">' + ts("Open CiviCRM Menu") + '</a>')
.prependTo('#adminmenumain')
.click(function() {
CRM.menubar.open('Home');
return false;
});
});