summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/experimental_flags.js
blob: 42b3fb8c6da82f78596e013785485d39fb7edb38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import $ from 'jquery';
import Cookies from 'js-cookie';

export default () => {
  $('.js-experiment-feature-toggle').on('change', e => {
    const el = e.target;

    Cookies.set(el.name, el.value, {
      expires: 365 * 10,
    });

    document.body.scrollTop = 0;
    window.location.reload();
  });
};