diff options
author | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:29:33 -0300 |
---|---|---|
committer | Ola Bini <ola.bini@gmail.com> | 2014-07-31 19:29:33 -0300 |
commit | 04cf441c5ae18400c6b4865b0b37a71718dc9d46 (patch) | |
tree | dd0b0d049ec00389e2d4561b226c46eb1682b997 /web-ui/app/js/foundation | |
parent | 639a663a4c37020003586438fdcd7ac529a00f10 (diff) |
Add web-ui based on previous code
Diffstat (limited to 'web-ui/app/js/foundation')
-rw-r--r-- | web-ui/app/js/foundation/off_canvas.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/web-ui/app/js/foundation/off_canvas.js b/web-ui/app/js/foundation/off_canvas.js new file mode 100644 index 00000000..7dfd6f34 --- /dev/null +++ b/web-ui/app/js/foundation/off_canvas.js @@ -0,0 +1,21 @@ +define(['flight/lib/component', 'page/events'], function (defineComponent, events) { + + return defineComponent(function() { + + this.toggleSlider = function (){ + $('.off-canvas-wrap').foundation('offcanvas', 'toggle', 'move-right'); + }; + + this.closeSlider = function (){ + if ($('.off-canvas-wrap').attr('class').indexOf('move-right') > -1) { + $('.off-canvas-wrap').foundation('offcanvas', 'toggle', 'move-right'); + } + }; + + this.after('initialize', function () { + this.on($('.left-off-canvas-toggle'), 'click', this.toggleSlider); + this.on($('#middle-pane-container'), 'click', this.closeSlider); + this.on($('#right-pane'), 'click', this.closeSlider); + }); + }); +}); |