Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

header.js 2.3 KB

You have to be logged in to leave a comment. Sign In
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
  1. $(function () {
  2. // navbar
  3. function closeDropdown(e) {
  4. // TODO: exclude mobile dropdown
  5. $(e).find('.submenu').hide();
  6. $(e).find('img.flip').css('transform', 'rotateX(0)');
  7. $(e).removeClass('active');
  8. $(e).find('.button').removeClass('active');
  9. $(e).blur();
  10. }
  11. const ENTER_KEY_CODE = 13;
  12. $('.dagshub-navbar .dropdown').on('click keydown', function(e) {
  13. if (e.which !== ENTER_KEY_CODE && e.type !== "click") {
  14. return;
  15. }
  16. e.stopPropagation();
  17. $.each($('.dagshub-navbar .dropdown'), (i, e) => {
  18. if (e != this) {
  19. closeDropdown(e);
  20. }
  21. })
  22. $(this).find('.submenu').toggle();
  23. if ($(this).find('.submenu').is(':visible')) {
  24. $(this).find('img.flip').css('transform', 'rotateX(180deg)');
  25. $(this).addClass('active');
  26. $(this).find('.button').addClass('active');
  27. } else {
  28. $(this).find('img.flip').css('transform', 'rotateX(0)');
  29. $(this).removeClass('active');
  30. $(this).find('.button').removeClass('active');
  31. $(this).blur();
  32. }
  33. });
  34. $(document).on('click', function (e) {
  35. $.each($('.dagshub-navbar .dropdown'), function (i, e) {
  36. closeDropdown(e)
  37. });
  38. })
  39. $('#__drawer').change(function () {
  40. if (this.checked) {
  41. $(".mobile.dagshub-navbar").css("visibility", "visible");
  42. $(".dagshub-navbar").addClass('active');
  43. $("#menu-toggle-label").html($("#menu-close-label").html())
  44. } else {
  45. $(".mobile.dagshub-navbar").css("visibility", "hidden");
  46. $(".dagshub-navbar").removeClass('active');
  47. $("#menu-toggle-label").html($("#menu-open-label").html())
  48. }
  49. });
  50. });
  51. (function() {
  52. let listeners = [];
  53. window.addAnalyticsListener = function (fn) {
  54. listeners.push(fn);
  55. }
  56. window.trackAnalyticsEvent = function(event, traits) {
  57. listeners.forEach(fn => fn(event, traits));
  58. };
  59. // Track events to the backend
  60. window.addAnalyticsListener((event) => {
  61. $.ajax({
  62. type: 'POST',
  63. url: '/api/internal/trackAnalyticsEvent',
  64. data: {
  65. event
  66. },
  67. })
  68. })
  69. })();
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...