From 4c3bc0004bef81306f4525b6af6cac4f4ffbfe84 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 16 Sep 2014 19:12:20 +0200 Subject: [PATCH] Hidden user tabs if only basic info is available --- public_html/js/Presenters/UserPresenter.js | 5 ++--- public_html/templates/user.tpl | 4 ++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/public_html/js/Presenters/UserPresenter.js b/public_html/js/Presenters/UserPresenter.js index 0dc0afa3..79a2b62c 100644 --- a/public_html/js/Presenters/UserPresenter.js +++ b/public_html/js/Presenters/UserPresenter.js @@ -72,12 +72,11 @@ App.Presenters.UserPresenter = function( function changeTab(targetTab) { var $link = $el.find('a[data-tab=' + targetTab + ']'); var $links = $link.closest('ul').find('a[data-tab]'); - var tab = $link.attr('data-tab'); - var $tabs = $link.closest('.tab-wrapper').find('.tab'); + var $tabs = $el.find('.tab-wrapper').find('.tab'); $links.removeClass('active'); $link.addClass('active'); $tabs.removeClass('active'); - $tabs.filter('[data-tab=' + tab + ']').addClass('active'); + $tabs.filter('[data-tab=' + targetTab + ']').addClass('active'); } return { diff --git a/public_html/templates/user.tpl b/public_html/templates/user.tpl index 7ca6d653..1d7f3ab9 100644 --- a/public_html/templates/user.tpl +++ b/public_html/templates/user.tpl @@ -8,6 +8,8 @@ <%= user.name %> + <% if ((canChangeBrowsingSettings || canChangeAccountSettings || canDeleteAccount)) { %> + + + <% } %>