Improve view all handling in tenderfoot
This commit is contained in:
parent
0c3511e331
commit
d6c0d92827
1 changed files with 19 additions and 6 deletions
|
@ -1,17 +1,21 @@
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#viewAllTab").on("click",function(){
|
$("#viewAllTab").on("click",function(){
|
||||||
$('[data-toggle="tab"]').parent().removeClass("active");
|
showViewAll();
|
||||||
$("#viewAllTab").parent().addClass("active");
|
|
||||||
$("#viewAllTab").addClass("active");
|
|
||||||
$(".tab-pane").addClass("fade active in");
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (location.hash) {
|
if (location.hash) {
|
||||||
$('li[href=\'' + location.hash + '\']').tab('show');
|
$('li[href=\'' + location.hash + '\']').tab('show');
|
||||||
|
if (location.hash == "#viewAll") {
|
||||||
|
showViewAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var activeTab = localStorage.getItem('activeTab');
|
var activeTab = localStorage.getItem('activeTab');
|
||||||
if (activeTab) {
|
if (activeTab) {
|
||||||
$('li[href="' + activeTab + '"]').tab('show');
|
$('li[href="' + activeTab + '"]').tab('show');
|
||||||
|
if (activeTab == "#viewAll") {
|
||||||
|
showViewAll();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('body').on('click', 'li[data-toggle=\'tab\']', function (e) {
|
$('body').on('click', 'li[data-toggle=\'tab\']', function (e) {
|
||||||
|
@ -23,8 +27,17 @@ $(document).ready(function(){
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
$(window).on('popstate', function () {
|
$(window).on('popstate', function () {
|
||||||
var anchor = location.hash ||
|
var anchor = location.hash || $('li[data-toggle=\'tab\']').first().attr('href');
|
||||||
$('li[data-toggle=\'tab\']').first().attr('href');
|
|
||||||
$('li[href=\'' + anchor + '\']').tab('show');
|
$('li[href=\'' + anchor + '\']').tab('show');
|
||||||
|
if (anchor == "#viewAll") {
|
||||||
|
showViewAll();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function showViewAll() {
|
||||||
|
$('[data-toggle="tab"]').parent().removeClass("active");
|
||||||
|
$("#viewAllTab").parent().addClass("active");
|
||||||
|
$("#viewAllTab").addClass("active");
|
||||||
|
$(".tab-pane").addClass("fade active in");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue