mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 04:49:36 -07:00
Clean up code
This commit is contained in:
parent
2c354ad783
commit
db7225fbad
2 changed files with 14 additions and 18 deletions
|
@ -95,7 +95,7 @@
|
||||||
clearSearchButton('history_table', history_table);
|
clearSearchButton('history_table', history_table);
|
||||||
|
|
||||||
$('#history_table_filter').prepend('<div class="btn-group" data-toggle="buttons" id="media_type-selection" style="padding-right: 15px;"> \
|
$('#history_table_filter').prepend('<div class="btn-group" data-toggle="buttons" id="media_type-selection" style="padding-right: 15px;"> \
|
||||||
<label class="btn btn-dark"> \
|
<label class="btn btn-dark active"> \
|
||||||
<input type="radio" name="media_type-filter" id="history-all" value="all" autocomplete="off"> All \
|
<input type="radio" name="media_type-filter" id="history-all" value="all" autocomplete="off"> All \
|
||||||
</label> \
|
</label> \
|
||||||
<label class="btn btn-dark"> \
|
<label class="btn btn-dark"> \
|
||||||
|
@ -110,18 +110,16 @@
|
||||||
</div>');
|
</div>');
|
||||||
|
|
||||||
$('#media_type-selection').on('change', function () {
|
$('#media_type-selection').on('change', function () {
|
||||||
media_type = $('input[name=media_type-filter]:checked', '#media_type-selection').val();
|
$('#media_type-selection > label').removeClass('active');
|
||||||
loadHistoryTable(media_type)
|
selected_filter = $('input[name=media_type-filter]:checked', '#media_type-selection');
|
||||||
|
$(selected_filter).closest('label').addClass('active');
|
||||||
|
media_type = $(selected_filter).val();
|
||||||
|
history_table.draw();
|
||||||
});
|
});
|
||||||
$('#media_type-selection > label').removeClass('active');
|
|
||||||
if (media_type == 'all') { $('#history-all').closest('label').addClass('active'); }
|
|
||||||
if (media_type == 'movie') { $('#history-movies').closest('label').addClass('active'); }
|
|
||||||
if (media_type == 'episode') { $('#history-tv_shows').closest('label').addClass('active'); }
|
|
||||||
if (media_type == 'track') { $('#history-music').closest('label').addClass('active'); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var media_type = 'all';
|
var media_type = 'all';
|
||||||
loadHistoryTable(media_type)
|
loadHistoryTable(media_type);
|
||||||
|
|
||||||
$('#row-edit-mode').on('click', function() {
|
$('#row-edit-mode').on('click', function() {
|
||||||
$('#row-edit-mode-alert').fadeIn(200);
|
$('#row-edit-mode-alert').fadeIn(200);
|
||||||
|
|
|
@ -342,7 +342,7 @@ from plexpy import helpers
|
||||||
clearSearchButton('history_table', history_table);
|
clearSearchButton('history_table', history_table);
|
||||||
|
|
||||||
$('#history_table_filter').prepend('<div class="btn-group" data-toggle="buttons" id="media_type-selection" style="padding-right: 15px;"> \
|
$('#history_table_filter').prepend('<div class="btn-group" data-toggle="buttons" id="media_type-selection" style="padding-right: 15px;"> \
|
||||||
<label class="btn btn-dark"> \
|
<label class="btn btn-dark active"> \
|
||||||
<input type="radio" name="media_type-filter" id="history-all" value="all" autocomplete="off"> All \
|
<input type="radio" name="media_type-filter" id="history-all" value="all" autocomplete="off"> All \
|
||||||
</label> \
|
</label> \
|
||||||
<label class="btn btn-dark"> \
|
<label class="btn btn-dark"> \
|
||||||
|
@ -357,19 +357,17 @@ from plexpy import helpers
|
||||||
</div>');
|
</div>');
|
||||||
|
|
||||||
$('#media_type-selection').on('change', function () {
|
$('#media_type-selection').on('change', function () {
|
||||||
media_type = $('input[name=media_type-filter]:checked', '#media_type-selection').val();
|
$('#media_type-selection > label').removeClass('active');
|
||||||
loadHistoryTable(media_type)
|
selected_filter = $('input[name=media_type-filter]:checked', '#media_type-selection');
|
||||||
|
$(selected_filter).closest('label').addClass('active');
|
||||||
|
media_type = $(selected_filter).val();
|
||||||
|
history_table.draw();
|
||||||
});
|
});
|
||||||
$('#media_type-selection > label').removeClass('active');
|
|
||||||
if (media_type == 'all') { $('#history-all').closest('label').addClass('active'); }
|
|
||||||
if (media_type == 'movie') { $('#history-movies').closest('label').addClass('active'); }
|
|
||||||
if (media_type == 'episode') { $('#history-tv_shows').closest('label').addClass('active'); }
|
|
||||||
if (media_type == 'track') { $('#history-music').closest('label').addClass('active'); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$( "#history-tab-btn" ).one( "click", function() {
|
$( "#history-tab-btn" ).one( "click", function() {
|
||||||
var media_type = 'all';
|
var media_type = 'all';
|
||||||
loadHistoryTable(media_type)
|
loadHistoryTable(media_type);
|
||||||
});
|
});
|
||||||
|
|
||||||
$( "#ip-tab-btn" ).one( "click", function() {
|
$( "#ip-tab-btn" ).one( "click", function() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue