script.js
872 Bytes
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
/**
* @package Better Preview
* @version 6.1.0
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://www.regularlabs.com
* @copyright Copyright © 2018 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
(function($) {
"use strict";
$(document).ready(function() {
$('.betterpreview-dropdown .dropdown-toggle').hover(function() {
var el = $(this).parent();
var menu = el.find('.dropdown-menu');
menu.stop(true, true).show();
el.addClass('open');
var hide = function() {
menu.stop(true, true).hide();
el.removeClass('open');
};
$('html').click(function() {
hide();
});
menu.hover(function() {
}, function() {
hide();
});
$('#menu').hover(function() {
hide();
});
});
});
})(jQuery);