debian-mirror-gitlab/app/assets/javascripts/experimental_flags.js

16 lines
307 B
JavaScript
Raw Normal View History

2018-05-09 12:01:36 +05:30
import $ from 'jquery';
2017-09-10 17:25:29 +05:30
import Cookies from 'js-cookie';
export default () => {
2018-12-13 13:39:08 +05:30
$('.js-experiment-feature-toggle').on('change', e => {
2017-09-10 17:25:29 +05:30
const el = e.target;
Cookies.set(el.name, el.value, {
expires: 365 * 10,
});
document.body.scrollTop = 0;
window.location.reload();
});
};