From 6152a1e913014e2d18d6fd6cf8fb5227054e32d3 Mon Sep 17 00:00:00 2001 From: Jonathan Wong Date: Fri, 15 Jan 2016 22:15:45 -0800 Subject: [PATCH] Fix bugs with media info table --- .../default/history_table_modal.html | 2 +- .../default/js/tables/history_table_modal.js | 19 +++++++------ .../default/js/tables/media_info_table.js | 2 +- data/interfaces/default/library.html | 20 ++++++------- data/interfaces/default/sync.html | 4 +-- data/interfaces/default/user.html | 12 ++++---- plexpy/libraries.py | 28 +++++++++---------- plexpy/plextv.py | 4 +-- plexpy/pmsconnect.py | 15 +++++----- plexpy/webserve.py | 9 ++---- 10 files changed, 55 insertions(+), 60 deletions(-) diff --git a/data/interfaces/default/history_table_modal.html b/data/interfaces/default/history_table_modal.html index 54e6c0c4..93ecdc67 100644 --- a/data/interfaces/default/history_table_modal.html +++ b/data/interfaces/default/history_table_modal.html @@ -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), diff --git a/data/interfaces/default/js/tables/history_table_modal.js b/data/interfaces/default/js/tables/history_table_modal.js index cb272a3f..942473a2 100644 --- a/data/interfaces/default/js/tables/history_table_modal.js +++ b/data/interfaces/default/js/tables/history_table_modal.js @@ -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('
' + transcode_dec + ' ' + cellData + '
'); } }, - "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) { diff --git a/data/interfaces/default/js/tables/media_info_table.js b/data/interfaces/default/js/tables/media_info_table.js index 18da0b38..cde9ff51 100644 --- a/data/interfaces/default/js/tables/media_info_table.js +++ b/data/interfaces/default/js/tables/media_info_table.js @@ -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); diff --git a/data/interfaces/default/library.html b/data/interfaces/default/library.html index 6d02e979..92221632 100644 --- a/data/interfaces/default/library.html +++ b/data/interfaces/default/library.html @@ -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', diff --git a/data/interfaces/default/sync.html b/data/interfaces/default/sync.html index 3d541219..26a81370 100644 --- a/data/interfaces/default/sync.html +++ b/data/interfaces/default/sync.html @@ -22,7 +22,7 @@
- +
@@ -54,7 +54,7 @@
State