-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeyBoardShortCuts.js
62 lines (54 loc) · 1.96 KB
/
keyBoardShortCuts.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
window.addEventListener('keydown', function(e) {
// console.log(e)
if(sourceCal == "alt" || sourceCal == "cal"){
if (e.altKey == true && e.keyCode == 87){
console.log('Alt + W');
document.getElementById('calSelector').value = "Week"
listDisplay = false;
week()
}
if (e.altKey == true && e.keyCode == 68){
console.log('Alt + d');
document.getElementById('calSelector').value = "Day"
listDisplay = false;
day()
myCalendarAlt.today()
}
if (e.altKey == true && e.keyCode == 77){
console.log('Alt + m');
document.getElementById('calSelector').value = "Month"
listDisplay = false;
month()
}
if (e.altKey == true && e.keyCode == 76){
console.log('Alt + L');
document.getElementById('calSelector').value = "List"
listDisplay = true;
showAsList()
}
if (e.ctrlKey == true && e.keyCode == 87){
console.log('Ctrl + W');
document.getElementById('calSelector').value = "Timeline Week"
sourceCal = "cal"
console.log("5")
myCalendarAlt.changeView("timelineWeek")
myCalendarAlt.today()
}
if (e.ctrlKey == true && e.keyCode == 68){
document.getElementById('calSelector').value = "Timeline Day"
console.log('Ctrl + d');
sourceCal = "cal"
console.log("5")
myCalendarAlt.changeView("timelineDay")
myCalendarAlt.today()
}
if (e.ctrlKey == true && e.keyCode == 77){
document.getElementById('calSelector').value = "Timeline Month"
console.log('Ctrl + m');
sourceCal = "cal"
console.log("5")
myCalendarAlt.changeView("timelineMonth")
myCalendarAlt.today()
}
}
});