diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index c82940abe..9ebc6159e 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -869,17 +869,7 @@ var AIRTIME = (function(AIRTIME) { } } - var selected = $("a[href$='"+location.hash+"']"); - if (selected.parent().data("selection-id") == AIRTIME.library.MediaTypeIntegerEnum.PODCAST) { - $("#library_display_wrapper").hide(); - $('#podcast_table_wrapper').show(); - oTable = mod.podcastDataTable; - } else { - $('#podcast_table_wrapper').hide(); - $("#library_display_wrapper").show(); - oTable = mod.libraryDataTable; - } - + AIRTIME.library.setCurrentTable(); setColumnFilter(oTable); oTable.fnSetFilteringDelay(350); @@ -1263,6 +1253,18 @@ var AIRTIME = (function(AIRTIME) { }; + mod.setCurrentTable = function() { + var selected = $("a[href$='"+location.hash+"']"); + if (selected.parent().data("selection-id") == AIRTIME.library.MediaTypeIntegerEnum.PODCAST) { + $("#library_display_wrapper").hide(); + $('#podcast_table_wrapper').show(); + oTable = mod.podcastDataTable; + } else { + $('#podcast_table_wrapper').hide(); + $("#library_display_wrapper").show(); + oTable = mod.libraryDataTable; + } + }; /** Create the podcast datatable widget */ mod.initPodcastDatatable = function() diff --git a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js index ca0f0dbc2..7f42edde2 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/main_builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/main_builder.js @@ -151,6 +151,8 @@ AIRTIME = (function(AIRTIME) { t = AIRTIME.library.libraryDataTable; } + AIRTIME.library.setCurrentTable(); + dashboardLink.find("a").attr("href", selected.attr("href")); AIRTIME.library.selectNone(); $(".media_type_selector").each(function () {