Welcome to mirror list, hosted at ThFree Co, Russian Federation.

navigation_toggle.vue « navigation_toggle « components « frontend « content - gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2243dc87644091c9ae7ca7ecf15467d8d93e0978 (plain)
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
<script>
export default {
  props: {
    targetSelector: {
      type: String,
      required: true,
    },
  },
  methods: {
    toggle() {
      const target = document.querySelector(this.targetSelector);

      if(!target) {
        return;
      }

      target.classList.toggle('active');
    }
  },
};
</script>

<template>
  <button type="button" class="btn nav-toggle" @click="toggle">
    <!--
    TODO: Replace arrows with 'angle-double-right' icon using the icon component from gitlab-ui
          We'll do this once https://gitlab.com/gitlab-org/gitlab-ui/issues/98 is complete.
          Issue to add gitlab-ui to this project: https://gitlab.com/gitlab-org/gitlab-docs/issues/443
    -->
    <span class="arrow"></span>
    <span class="arrow"></span>
    <div class="label">Collapse sidebar</div>
  </button>
</template>