From 3010fa01fa998e2d6de15d37f5a3ae534538b5c4 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Mon, 16 Nov 2015 11:36:18 -0500 Subject: [PATCH] Add processing div to podcast episodes table --- .../public/js/airtime/library/library.js | 17 +++++++++++------ .../public/js/airtime/library/podcast.js | 4 ++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index ce86d8a9a..988158ecb 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -1379,6 +1379,15 @@ var AIRTIME = (function(AIRTIME) { return this.getSelectedRows().length >= 1; } }); + + var openPodcastEpisodeTable = function (podcast) { + mod.podcastEpisodeTableWidget.reload(podcast.id); + mod.podcastTableWidget.clearSelection(); + mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES); + mod.podcastEpisodeDataTable.closest(".dataTables_wrapper").find(".dataTables_processing") + .addClass("block-overlay").css("visibility", "visible"); + }; + podcastToolbarButtons["ViewEpisodes"] = { title : $.i18n._("View Episodes"), iconClass : "icon-chevron-right", @@ -1387,9 +1396,7 @@ var AIRTIME = (function(AIRTIME) { eventHandlers : { click: function () { var podcast = mod.podcastTableWidget.getSelectedRows()[0]; - mod.podcastEpisodeTableWidget.reload(podcast.id); - mod.podcastTableWidget.clearSelection(); - mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES); + openPodcastEpisodeTable(podcast); } }, validateConstraints: function () { @@ -1427,9 +1434,7 @@ var AIRTIME = (function(AIRTIME) { // in the left-hand pane. mod.podcastTableWidget.assignDblClickHandler(function () { var podcast = mod.podcastDataTable.fnGetData(this); - mod.podcastEpisodeTableWidget.reload(podcast.id); - mod.podcastTableWidget.clearSelection(); - mod.setCurrentTable(mod.DataTableTypeEnum.PODCAST_EPISODES); + openPodcastEpisodeTable(podcast); }); mod.podcastDataTable = mod.podcastTableWidget.getDatatable(); diff --git a/airtime_mvc/public/js/airtime/library/podcast.js b/airtime_mvc/public/js/airtime/library/podcast.js index ea4eb2b04..9f90eeb14 100644 --- a/airtime_mvc/public/js/airtime/library/podcast.js +++ b/airtime_mvc/public/js/airtime/library/podcast.js @@ -539,6 +539,7 @@ var AIRTIME = (function (AIRTIME) { */ mod.importSelectedEpisodes = function (episodes, dt) { $.each(episodes, function () { + // remainingDiskSpace is defined in layout.phtml if (this.enclosure.length > remainingDiskSpace) { alert("You don't have enough disk space to import " + this.title); return false; @@ -623,6 +624,9 @@ var AIRTIME = (function (AIRTIME) { }, fnDrawCallback: function () { AIRTIME.library.drawEmptyPlaceholder(this); + // Hide the processing div + var dt = this.getDatatable(); + !dt || dt.closest(".dataTables_wrapper").find(".dataTables_processing").css("visibility", "hidden"); } } );