mirror of
https://git.teknik.io/Teknikode/Teknik.git
synced 2023-08-02 14:16:22 +02:00
Issue #101 - Fixed stats and service data tabs not initially loading and remembering your selection.
This commit is contained in:
parent
f8c5c739d8
commit
f13f390ab4
@ -14,13 +14,13 @@
|
||||
@if (Config.StatsConfig.Enabled)
|
||||
{
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation"><a href="#site-stats" role="tab" data-toggle="tab">Site Statistics</a></li>
|
||||
<li role="presentation" class="active"><a href="#site-stats" role="tab" data-toggle="tab">Site Statistics</a></li>
|
||||
<li role="presentation"><a href="#transactions" role="tab" data-toggle="tab">Transactions</a></li>
|
||||
<li role="presentation"><a href="#takedowns" role="tab" data-toggle="tab">Takedowns</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div role="tabpanel" class="tab-pane" id="site-stats">
|
||||
<div role="tabpanel" class="tab-pane active" id="site-stats">
|
||||
<h2 class="text-center"><b>Site Statistics</b></h2>
|
||||
<hr>
|
||||
@if (Config.PiwikConfig.Enabled)
|
||||
|
@ -11,13 +11,13 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li><a href="#uploads" data-toggle="tab"> Uploads </a></li>
|
||||
<li class="active"><a href="#uploads" data-toggle="tab"> Uploads </a></li>
|
||||
<li><a href="#pastes" data-toggle="tab"> Pastes </a></li>
|
||||
<li><a href="#shortenedUrls" data-toggle="tab"> Shortened Urls </a></li>
|
||||
<li><a href="#vaults" data-toggle="tab"> Vaults </a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="uploads">
|
||||
<div class="tab-pane active" id="uploads">
|
||||
@foreach (Teknik.Areas.Upload.Models.Upload upload in Model.Uploads)
|
||||
{
|
||||
<div class="panel panel-default" id="@upload.Url">
|
||||
|
@ -9,6 +9,17 @@ $(document).ready(function () {
|
||||
$('#oneTime-section').collapse('hide');
|
||||
$('#donations-section').collapse('hide');
|
||||
$('#takedowns-section').collapse('hide');
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function () {
|
||||
// save the latest tab; use cookies if you like 'em better:
|
||||
localStorage.setItem('lastTab_stats', $(this).attr('href'));
|
||||
});
|
||||
|
||||
// go to the latest tab, if it exists:
|
||||
var lastTab = localStorage.getItem('lastTab_stats');
|
||||
if (lastTab) {
|
||||
$('a[href="' + lastTab + '"]').tab('show');
|
||||
}
|
||||
|
||||
///* ----------------------------------------
|
||||
// CPU Usage
|
||||
|
@ -23,6 +23,17 @@ $(document).ready(function () {
|
||||
var element = $('#vaults [id="' + id + '"');
|
||||
deleteItem(deleteVaultURL, id, element, "Are you sure you want to delete this vault?");
|
||||
});
|
||||
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function () {
|
||||
// save the latest tab; use cookies if you like 'em better:
|
||||
localStorage.setItem('lastTab_serviceData', $(this).attr('href'));
|
||||
});
|
||||
|
||||
// go to the latest tab, if it exists:
|
||||
var lastTab = localStorage.getItem('lastTab_serviceData');
|
||||
if (lastTab) {
|
||||
$('a[href="' + lastTab + '"]').tab('show');
|
||||
}
|
||||
});
|
||||
|
||||
function deleteItem(url, id, element, confirmationMsg) {
|
||||
|
@ -67,18 +67,6 @@ $(function () {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
// for bootstrap 3 use 'shown.bs.tab', for bootstrap 2 use 'shown' in the next line
|
||||
$('a[data-toggle="tab"]').on('shown.bs.tab', function () {
|
||||
// save the latest tab; use cookies if you like 'em better:
|
||||
localStorage.setItem('lastTab', $(this).attr('href'));
|
||||
});
|
||||
|
||||
// go to the latest tab, if it exists:
|
||||
var lastTab = localStorage.getItem('lastTab');
|
||||
if (lastTab) {
|
||||
$('[href="' + lastTab + '"]').tab('show');
|
||||
}
|
||||
|
||||
// Auo-select bitcoin address
|
||||
$('#bitcoin_address_footer').click(function() {
|
||||
SelectAll('bitcoin_address_footer');
|
||||
|
Loading…
Reference in New Issue
Block a user