diff options
Diffstat (limited to 'app/javascript/flavours/glitch/packs/settings.js')
-rw-r--r-- | app/javascript/flavours/glitch/packs/settings.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/javascript/flavours/glitch/packs/settings.js b/app/javascript/flavours/glitch/packs/settings.js new file mode 100644 index 000000000..4c85f6556 --- /dev/null +++ b/app/javascript/flavours/glitch/packs/settings.js @@ -0,0 +1,20 @@ +import 'packs/public-path'; +import loadPolyfills from 'flavours/glitch/load_polyfills'; +import ready from 'flavours/glitch/ready'; +import loadKeyboardExtensions from 'flavours/glitch/load_keyboard_extensions'; +import 'cocoon-js-vanilla'; + +function main() { + const { delegate } = require('@rails/ujs'); + + delegate(document, '.sidebar__toggle__icon', 'click', () => { + document.querySelector('.sidebar ul').classList.toggle('visible'); + }); +} + +loadPolyfills() + .then(main) + .then(loadKeyboardExtensions) + .catch(error => { + console.error(error); + }); |