-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathae_engine.js
83 lines (68 loc) · 2.36 KB
/
ae_engine.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
jQuery(document).ready(function($){
$.ajax({
type: 'GET',
url: '/aedrupal/get_dashboard',
complete: function(result) {
// console.log(result);
if (result.status != 404) {
var data = JSON.parse(result.response);
$('#ae-title').html(data.points + ' Bonus Points');
$('#ae-content').html(data.dashboard);
$('#message-api-content').html(data.message);
var message = data.message;
if(message != false) {
Modalbox.show(message, {title:'New Message'});
}
}
}
});
$.ajax({
type: 'POST',
url: '/aedrupal/register_url',
data: {
current_page: window.location.href
}
});
var ddOpenTimeout;
var dMenuPosTimeout;
$(".dropdown").hover(function() {
var DELAY = 300;
var ddToggle = $(this).children('.dropdown-toggle');
var ddMenu = $(this).children('.dropdown-menu');
var ddWrapper = ddMenu.parent();
ddMenu.css("left", "");
ddMenu.css("right", "");
if ($(this).hasClass('clickable-dropdown'))
{
if ($(this).hasClass('open'))
{
$(this).children('.dropdown-menu').stop(true, true).delay(DELAY).fadeIn(300);
}
}
else
{
clearTimeout(ddOpenTimeout);
ddOpenTimeout = setTimeout(function() {
ddWrapper.addClass('open');
}, DELAY);
$(this).children('.dropdown-menu').stop(true, true).delay(DELAY).fadeIn(300);
}
clearTimeout(dMenuPosTimeout);
dMenuPosTimeout = setTimeout(function() {
if (ddMenu.offset().left < 0)
{
var space = ddWrapper.offset().left;
ddMenu.css("left", (-1)*space);
ddMenu.css("right", "auto");
}
}, DELAY);
}, function() {
var ddMenu = $(this).children('.dropdown-menu');
clearTimeout(ddOpenTimeout); ddMenu.stop(true, true).delay(150).fadeOut(300);
if (ddMenu.is(":hidden"))
{
ddMenu.hide();
}
$(this).removeClass('open');
});
});