-
Notifications
You must be signed in to change notification settings - Fork 268
/
Copy pathactions.js
43 lines (41 loc) · 1.48 KB
/
actions.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
$(document).ready(function() {
var hash_list = "";
$("#menu-introduction").addClass("selected");
if(window.location.hash.startsWith("#installation")) {
hash_list = decodeURIComponent(window.location.hash).split("?");
setTimeout(function () {
$("#menu-installation").trigger("click");
}, 10);
// } else {
// setTimeout(function () {
// $("#menu-introduction").trigger("click");
// }, 10);
}
$(".menu-element").on("click", function() {
$(this).parent().children().each(function() {
$(this).removeClass("selected");
});
$(this).addClass("selected");
if($(this).attr("id") == "menu-installation") {
// $("#div-introduction").hide();
// $("#div-installation").show();
// if(!window.location.hash.startsWith("#installation"))
// window.location.hash = "#installation";
let href = "https://pytorch-extension.intel.com/installation";
if(hash_list.length > 1)
href += "?" + hash_list[1];
// window.open(href, '_blank');
// window.location.hash = "#introduction";
window.location.href = href;
$("#menu-introduction").addClass("selected");
$("#menu-installation").removeClass("selected");
} else if($(this).attr("id") == "menu-introduction") {
$("#div-introduction").show();
$("#div-installation").hide();
if(!window.location.hash.startsWith("#introduction"))
window.location.hash = "#introduction";
} else {
// Do nothing
}
});
});