From d42c8b528eb595101954f478e0024e3f079f6fbf Mon Sep 17 00:00:00 2001 From: schneefux Date: Wed, 22 Mar 2017 19:19:26 +0100 Subject: first implementation of fun stats site --- .../assets/bootstrap-material-design/js/drawer.js | 170 +++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 templates/assets/bootstrap-material-design/js/drawer.js (limited to 'templates/assets/bootstrap-material-design/js/drawer.js') diff --git a/templates/assets/bootstrap-material-design/js/drawer.js b/templates/assets/bootstrap-material-design/js/drawer.js new file mode 100644 index 0000000..ef0586e --- /dev/null +++ b/templates/assets/bootstrap-material-design/js/drawer.js @@ -0,0 +1,170 @@ +import BaseLayout from './baseLayout' + +const Drawer = (($) => { + + /** + * ------------------------------------------------------------------------ + * Constants + * ------------------------------------------------------------------------ + */ + const NAME = 'drawer' + const DATA_KEY = `bmd.${NAME}` + const JQUERY_NAME = `bmd${NAME.charAt(0).toUpperCase() + NAME.slice(1)}` + const JQUERY_NO_CONFLICT = $.fn[JQUERY_NAME] + + const Keycodes = { + ESCAPE: 27 + //ENTER: 13, + //SPACE: 32 + } + + const ClassName = { + IN: 'in', + DRAWER_IN: `bmd-drawer-in`, + DRAWER_OUT: `bmd-drawer-out`, + DRAWER: 'bmd-layout-drawer', + CONTAINER: 'bmd-layout-container' + } + + const Default = { + focusSelector: `a, button, input` + } + + /** + * ------------------------------------------------------------------------ + * Class Definition + * ------------------------------------------------------------------------ + */ + class Drawer extends BaseLayout { + + // $element is expected to be the trigger + // i.e.