From a222f7ac7d05d9ab0ef8d9b809d01ebfc0f854bd Mon Sep 17 00:00:00 2001 From: Gabriel Albo Date: Tue, 3 Mar 2015 18:41:56 -0300 Subject: Refactoring the tags visibility toggle function --- web-ui/app/js/foundation/off_canvas.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'web-ui/app/js') diff --git a/web-ui/app/js/foundation/off_canvas.js b/web-ui/app/js/foundation/off_canvas.js index f5454062..a7a39bba 100644 --- a/web-ui/app/js/foundation/off_canvas.js +++ b/web-ui/app/js/foundation/off_canvas.js @@ -22,16 +22,16 @@ define(['flight/lib/component', 'page/events'], function (defineComponent, event this.closeSlider = function (ev){ ev.preventDefault(); $('.exit-off-canvas').click(); - if ($('#custom-tag-list').hasClass('expanded')) { - $('#custom-tag-list').removeClass('expanded'); - } else { - $('#custom-tag-list').addClass('expanded'); - } + this.toggleTagsVisibility(); }; this.toggleSlideContent = function (ev) { ev.preventDefault(); - $('.left-off-canvas-toggle').click(); + $('.left-off-canvas-toggle').click(); + this.toggleTagsVisibility(); + }; + + this.toggleTagsVisibility = function () { if ($('#custom-tag-list').hasClass('expanded')) { $('#custom-tag-list').removeClass('expanded'); } else { -- cgit v1.2.3