From 109a3365046104ad2f6bc9f2310f58b1babea692 Mon Sep 17 00:00:00 2001 From: Duncan Sommerville Date: Mon, 31 Aug 2015 14:36:44 -0400 Subject: [PATCH] CC-6124 - Fix Add to Current Playlist button --- .../library/events/library_showbuilder.js | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js index d62e8f90a..0d6cb047f 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -18,17 +18,11 @@ var AIRTIME = (function(AIRTIME) { check = true; } - if (shows.length === 0) { - check = false; - } - - if (check) { - AIRTIME.button.enableButton("btn-group #library-plus", false); - } else { - AIRTIME.button.disableButton("btn-group #library-plus", false); - } - if ($("#show_builder_table").is(":visible")) { + if (shows.length === 0) { + check = false; + } + if ($cursor.length !== 0) { btnText = $.i18n._('Add after selected items'); } else if (current.length !== 0) { @@ -42,6 +36,13 @@ var AIRTIME = (function(AIRTIME) { btnText = $.i18n._('Add to current playlist'); } } + + if (check) { + AIRTIME.button.enableButton("btn-group #library-plus", false); + } else { + AIRTIME.button.disableButton("btn-group #library-plus", false); + } + AIRTIME.library.changeAddButtonText($('.btn-group #library-plus #lib-plus-text'), btnText); };