summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/experimental_flags.js
blob: 1d60847147b297a9fdef163d3e5677c347ddd154 (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();
  });
};