-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
48 lines (44 loc) · 1.43 KB
/
script.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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
jQuery(function () {
/**
* Mobile menu open handling
*/
const $tabs = jQuery('nav.notos ul.navtabs');
$tabs.on('click', '.primary .opener', function (event) {
$tabs.find('li').removeClass('active');
jQuery(this).parent().addClass('active').next('.secondary').addClass('active');
event.stopPropagation();
event.preventDefault();
});
/**
* Close other notos toggle menus when opening a new one
*/
jQuery('input.notos-toggle').on('click', function () {
jQuery('input.notos-toggle').not(this).prop('checked', false);
});
/**
* Close notos toggle menus on clicks elsewhere
*/
jQuery('body').on('click', function(event) {
const $target = jQuery(event.target);
if ($target.is('.notos-toggle') || $target.parents('.notos-toggle').length) return;
const $toggle = jQuery('input.notos-toggle');
if ($toggle.prop('checked')) {
$toggle.prop('checked', false);
}
});
});
/**
* Editor button
*/
if (typeof window.toolbar !== 'undefined') {
const wrapConfig = window.toolbar.find((button) => button.title === 'Wrap Plugin');
if (wrapConfig) {
wrapConfig.list.splice(1, 0, {
type: "format",
title: 'simple highlight box',
icon: "../../tpl/notos/ico/rectangle.svg",
open: "<WRAP notos center round 60%>",
close: "</WRAP>",
});
}
}