-
Notifications
You must be signed in to change notification settings - Fork 2
/
script.js
79 lines (72 loc) · 2.78 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
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
$(document).ready(function(){
$(".minimize").click(function(){
if($(this).parents(".bk-code-template").find(".bk-code-header-minimized").hasClass("hidden")) {
$(this).parents(".bk-code-template").find(".bk-code-header-minimized").removeClass("hidden");
$(this)
.parents(".bk-code-template")
.find(".bk-code-header, .bk-code-file, .bk-code-content")
.hide("0.15");
// Remove shadow from parents(".bk-code-template")
$(this).parents(".bk-code-template").removeClass("shadow-small");
} else {
$(this).parents(".bk-code-template").find(".bk-code-header-minimized").addClass("hidden");
$(this)
.parents(".bk-code-template")
.find(".bk-code-header, .bk-code-file, .bk-code-content")
.show("0.15");
// Display shadow from parents(".bk-code-template")
$(this).parents(".bk-code-template").addClass("shadow-small");
}
});
$(".close-code").click(function(){
$(this)
.parents(".bk-code-header")
.nextAll()
.addClass("hidden");
});
$(".maximize").click(function(){
$(this)
.parents(".bk-code-header")
.nextAll()
.removeClass("hidden");
});
$(".close-code-file").click(function(){
// Hide [x] and change to square icon []
$(this).children("i.bi-app").toggleClass("hidden");
// Hide square icon [] and change to x
$(this).children("i.bi-x").toggleClass("hidden");
$(this)
.parents(".bk-code-file")
.nextAll()
.toggleClass("hidden");
// Hide copy image when the code content is not displayed
// $(this)
// .parents(".bk-code-file")
// .find(".code-copy")
// .toggleClass("hidden");
});
// $(".legend-on-mobile").click(function(){
// $(".legend-on-mobile-content").toggleClass("hide-legend-on-mobile-content");
// });
$(".docs").click(function(){
$("html, body").addClass("overflow-hidden");
$(".docs-modal").addClass("docs-indexer");
});
$(".close-docs-modal").click(function(){
$("html, body").removeClass("overflow-hidden");
$(".docs-modal").removeClass("docs-indexer");
});
/*$(".code-copy-val").click(function(){
var $codeVal =
$(this)
.parents(".bk-code-file")
.next(".bk-code-content")
.children()
.find("textarea.code-value")
.val();
// $("body").append($codeVal);
$codeVal.select();
document.execCommand("copy");
$codeVal.remove();
}); */
});