forked from gooddata/gooddata-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-select.js
More file actions
27 lines (24 loc) · 839 Bytes
/
Copy pathcode-select.js
File metadata and controls
27 lines (24 loc) · 839 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
(function ($) {
$(document).ready(function () {
$(".gd-docs-code-select__tab").on("click", setActive);
$(".gd-docs-code-select__osdetection .gd-docs-code-select__tab").each(osDetection);
});
var setActive = function() {
if(!$(this).hasClass("active")) {
$(this).siblings().removeClass("active");
$(this)
.addClass("active")
.parent()
.parent()
.find(".gd-docs-code-select__code")
.removeClass("active")
.filter(".lang-" + $(this).data("lang"))
.addClass("active");
}
}
var osDetection = function() {
if(window.navigator.userAgent.indexOf($(this).data("user-agent")) >= 0) {
$(this).trigger("click");
}
}
}(jQuery));