Fix bugs with media info table

This commit is contained in:
Jonathan Wong 2016-01-15 22:15:45 -08:00
parent 002cb93187
commit 6152a1e913
10 changed files with 55 additions and 60 deletions

View file

@ -35,7 +35,7 @@
$('#date-header').html(moment('${data}','YYYY-MM-DD').format('ddd MMM Do YYYY'));
history_table_modal_options.ajax = {
url: 'get_history',
type: "post",
type: 'post',
data: function ( d ) {
return {
json_data: JSON.stringify(d),

View file

@ -25,6 +25,7 @@ history_table_modal_options = {
"serverSide": true,
"pageLength": 10,
"lengthChange": false,
"autoWidth": false,
"order": [ 0, 'desc'],
"columnDefs": [
{
@ -37,9 +38,9 @@ history_table_modal_options = {
$(td).html(moment(cellData,"X").format(time_format));
}
},
"searchable": false,
"width": "10%",
"className": "no-wrap",
"width": "10%"
"searchable": false
},
{
"targets": [1],
@ -51,9 +52,9 @@ history_table_modal_options = {
$(td).html(moment(cellData,"X").format(time_format));
}
},
"searchable": false,
"width": "10%",
"className": "no-wrap",
"width": "10%"
"searchable": false
},
{
"targets": [2],
@ -69,8 +70,8 @@ history_table_modal_options = {
$(td).html(cellData);
}
},
"className": "no-wrap hidden-xs",
"width": "15%"
"width": "15%",
"className": "no-wrap hidden-xs"
},
{
"targets": [3],
@ -88,8 +89,8 @@ history_table_modal_options = {
$(td).html('<div><a href="#" data-target="#info-modal" data-toggle="modal"><div style="float: left;">' + transcode_dec + '&nbsp' + cellData + '</div></a></div>');
}
},
"className": "no-wrap hidden-sm hidden-xs modal-control",
"width": "20%"
"width": "25%",
"className": "no-wrap hidden-sm hidden-xs modal-control"
},
{
"targets": [4],
@ -116,7 +117,7 @@ history_table_modal_options = {
}
}
},
"width": "30%"
"width": "40%"
}
],
"drawCallback": function (settings) {

View file

@ -397,7 +397,7 @@ function createChildTableMedia(row, rowData) {
});
// Child table expand detailed media info
$('table[id^=media_info_child]').on('click', '> tbody > tr > td.expand-media-info a', function () {
$('table[id^=media_info_child-' + rowData['rating_key'] + ']').on('click', '> tbody > tr > td.expand-media-info a', function () {
var table_id = $(this).closest('table').data('id');
var tr = $(this).closest('tr');
var row = media_info_child_table[table_id].row(tr);

View file

@ -441,15 +441,15 @@ DOCUMENTATION :: END
});
function recentlyWatched() {
var widthVal = $('body').find("#library-recently-watched").width();
var tmp = (widthVal-32) / 180;
var widthVal = $("#library-recently-watched").width();
var tmp = (widthVal-25) / 175;
if (tmp > 0) {
containerSize = parseInt(tmp);
var containerSize = parseInt(tmp);
} else {
containerSize = 1;
var containerSize = 1;
}
// Populate recently watched
$.ajax({
url: 'get_library_recently_watched',
@ -465,15 +465,15 @@ DOCUMENTATION :: END
}
function recentlyAdded() {
var widthVal = $('body').find("#library-recently-added").width();
var tmp = (widthVal-32) / 180;
var widthVal = $("#library-recently-added").width();
var tmp = (widthVal-25) / 175;
if (tmp > 0) {
containerSize = parseInt(tmp);
var containerSize = parseInt(tmp);
} else {
containerSize = 1;
var containerSize = 1;
}
// Populate recently added
$.ajax({
url: 'get_library_recently_added',

View file

@ -22,7 +22,7 @@
</div>
</div>
<div class='table-card-back'>
<table class="display" id="sync_table" width="100%">
<table class="display no-fixed" id="sync_table" width="100%">
<thead>
<tr>
<th align='left' id="state">State</th>
@ -54,7 +54,7 @@
<script>
$(document).ready(function() {
sync_table_options.ajax = {
"url": "get_sync"
url: 'get_sync'
}
sync_table = $('#sync_table').DataTable(sync_table_options);
var colvis = new $.fn.dataTable.ColVis( sync_table, { buttonText: '<i class="fa fa-columns"></i> Select columns', buttonClass: 'btn btn-dark' } );

View file

@ -218,7 +218,7 @@ from plexpy import helpers
</div>
</div>
<div class="table-card-back">
<table class="display" id="sync_table" width="100%">
<table class="display no-fixed" id="sync_table" width="100%">
<thead>
<tr>
<th align="left" id="state">State</th>
@ -471,15 +471,15 @@ from plexpy import helpers
});
function recentlyWatched() {
var widthVal = $('body').find("#user-recently-watched").width();
var tmp = (widthVal-32) / 180;
var widthVal = $("#user-recently-watched").width();
var tmp = (widthVal-25) / 175;
if (tmp > 0) {
containerSize = parseInt(tmp);
var containerSize = parseInt(tmp);
} else {
containerSize = 1;
var containerSize = 1;
}
// Populate recently watched
$.ajax({
url: 'get_user_recently_watched',