Hidden user tabs if only basic info is available

This commit is contained in:
Marcin Kurczewski 2014-09-16 19:12:20 +02:00
parent 1a41e60515
commit 4c3bc0004b
2 changed files with 6 additions and 3 deletions

View file

@ -72,12 +72,11 @@ App.Presenters.UserPresenter = function(
function changeTab(targetTab) { function changeTab(targetTab) {
var $link = $el.find('a[data-tab=' + targetTab + ']'); var $link = $el.find('a[data-tab=' + targetTab + ']');
var $links = $link.closest('ul').find('a[data-tab]'); var $links = $link.closest('ul').find('a[data-tab]');
var tab = $link.attr('data-tab'); var $tabs = $el.find('.tab-wrapper').find('.tab');
var $tabs = $link.closest('.tab-wrapper').find('.tab');
$links.removeClass('active'); $links.removeClass('active');
$link.addClass('active'); $link.addClass('active');
$tabs.removeClass('active'); $tabs.removeClass('active');
$tabs.filter('[data-tab=' + tab + ']').addClass('active'); $tabs.filter('[data-tab=' + targetTab + ']').addClass('active');
} }
return { return {

View file

@ -8,6 +8,8 @@
<%= user.name %> <%= user.name %>
</div> </div>
<% if ((canChangeBrowsingSettings || canChangeAccountSettings || canDeleteAccount)) { %>
<ul> <ul>
<li> <li>
<a href="#/user/<%= user.name %>" data-tab="basic-info">Basic information</a> <a href="#/user/<%= user.name %>" data-tab="basic-info">Basic information</a>
@ -31,6 +33,8 @@
</li> </li>
<% } %> <% } %>
</ul> </ul>
<% } %>
</div> </div>
<div class="tab basic-info" data-tab="basic-info"> <div class="tab basic-info" data-tab="basic-info">