github.com/outbrain/consul@v1.4.5/ui-v2/app/components/hashicorp-consul.js (about)

     1  import Component from '@ember/component';
     2  import { get, set } from '@ember/object';
     3  const $html = document.documentElement;
     4  const $body = document.body;
     5  export default Component.extend({
     6    isDropdownVisible: false,
     7    didInsertElement: function() {
     8      $html.classList.remove('template-with-vertical-menu');
     9    },
    10    actions: {
    11      dropdown: function(e) {
    12        if (get(this, 'dcs.length') > 0) {
    13          set(this, 'isDropdownVisible', !get(this, 'isDropdownVisible'));
    14        }
    15      },
    16      change: function(e) {
    17        if (e.target.checked) {
    18          $html.classList.add('template-with-vertical-menu');
    19          $body.style.height = $html.style.height = window.innerHeight + 'px';
    20        } else {
    21          $html.classList.remove('template-with-vertical-menu');
    22          $body.style.height = $html.style.height = null;
    23        }
    24      },
    25    },
    26  });