summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Albo <gabriel@albo.com.br>2015-03-02 16:51:47 -0300
committerGabriel Albo <gabriel@albo.com.br>2015-03-02 16:51:47 -0300
commit1b4eb33206101403b0d2929f6e4ddc99ad4372da (patch)
tree65d5b349d03858790c528217e822a7f4e44f116f
parent94979889cf27e597b1ad4c84ec4ab08aa5c29a6a (diff)
Moving side bar js code to off-canvas component
-rw-r--r--web-ui/app/js/foundation/off_canvas.js14
-rw-r--r--web-ui/app/templates/tags/tag_list.hbs15
2 files changed, 14 insertions, 15 deletions
diff --git a/web-ui/app/js/foundation/off_canvas.js b/web-ui/app/js/foundation/off_canvas.js
index 8dfd75ba..80bbfd31 100644
--- a/web-ui/app/js/foundation/off_canvas.js
+++ b/web-ui/app/js/foundation/off_canvas.js
@@ -19,13 +19,25 @@ define(['flight/lib/component', 'page/events'], function (defineComponent, event
return defineComponent(function() {
- this.closeSlider = function (){
+ this.closeSlider = function (ev){
+ ev.preventDefault();
$('.exit-off-canvas').click();
};
+ this.toggleSlideContent = function (ev) {
+ ev.preventDefault();
+ $('.left-off-canvas-toggle').click();
+ if ($('#custom-tag-list').hasClass('expanded')) {
+ $('#custom-tag-list').removeClass('expanded');
+ } else {
+ $('#custom-tag-list').addClass('expanded');
+ }
+ }
+
this.after('initialize', function () {
this.on($('#middle-pane-container'), 'click', this.closeSlider);
this.on($('#right-pane'), 'click', this.closeSlider);
+ this.on($('.side-nav-toggle'), 'click', this.toggleSlideContent);
});
});
});
diff --git a/web-ui/app/templates/tags/tag_list.hbs b/web-ui/app/templates/tags/tag_list.hbs
index e6108224..e265354f 100644
--- a/web-ui/app/templates/tags/tag_list.hbs
+++ b/web-ui/app/templates/tags/tag_list.hbs
@@ -3,17 +3,4 @@
<i class="fa fa-tags"></i>
<span class="tag-label">Tags</span>
</div>
-<ul id="custom-tag-list"></ul>
-
-<script>
-$('.side-nav-toggle').click(function (ev) {
- ev.preventDefault();
- $('.left-off-canvas-toggle').click();
- if ($('#custom-tag-list').hasClass('expanded')) {
- $('#custom-tag-list').removeClass('expanded');
- }
- else {
- $('#custom-tag-list').addClass('expanded');
- }
- });
-</script> \ No newline at end of file
+<ul id="custom-tag-list"></ul> \ No newline at end of file