From 1698aae251809b6fc55eb4808c2002da34794c25 Mon Sep 17 00:00:00 2001 From: denise Date: Tue, 18 Sep 2012 10:53:19 -0400 Subject: [PATCH] CC-4466: Buttons on Now Playing page are clickable even though they are disabled -fixed --- .../public/js/airtime/buttons/buttons.js | 7 ++++++- .../library/events/library_playlistbuilder.js | 4 ++-- .../library/events/library_showbuilder.js | 4 ++-- .../public/js/airtime/library/library.js | 4 ++-- .../public/js/airtime/showbuilder/builder.js | 18 +++++++++--------- 5 files changed, 21 insertions(+), 16 deletions(-) diff --git a/airtime_mvc/public/js/airtime/buttons/buttons.js b/airtime_mvc/public/js/airtime/buttons/buttons.js index 23a904001..a8db230b1 100644 --- a/airtime_mvc/public/js/airtime/buttons/buttons.js +++ b/airtime_mvc/public/js/airtime/buttons/buttons.js @@ -6,8 +6,11 @@ var AIRTIME = (function(AIRTIME) { } mod = AIRTIME.button; - mod.isDisabled = function(c) { + mod.isDisabled = function(c, useParent) { var button = $("." + c); + if (useParent) { + button = button.parent(); + } if (button.hasClass(DISABLED_CLASS)) { return true; @@ -25,6 +28,7 @@ var AIRTIME = (function(AIRTIME) { if (button.hasClass(DISABLED_CLASS)) { button.removeClass(DISABLED_CLASS); + button.removeAttr('disabled'); } }; @@ -37,6 +41,7 @@ var AIRTIME = (function(AIRTIME) { if (!button.hasClass(DISABLED_CLASS)) { button.addClass(DISABLED_CLASS); + button.attr('disabled', 'disabled'); } }; diff --git a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js index 17aa3bb4e..92f0bcdbd 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_playlistbuilder.js @@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #library-plus", true); + AIRTIME.button.enableButton("btn-group #library-plus", false); } else { - AIRTIME.button.disableButton("btn-group #library-plus", true); + AIRTIME.button.disableButton("btn-group #library-plus", false); } }; 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 7bddd8049..cf67419cd 100644 --- a/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js +++ b/airtime_mvc/public/js/airtime/library/events/library_showbuilder.js @@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #library-plus", true); + AIRTIME.button.enableButton("btn-group #library-plus", false); } else { - AIRTIME.button.disableButton("btn-group #library-plus", true); + AIRTIME.button.disableButton("btn-group #library-plus", false); } }; diff --git a/airtime_mvc/public/js/airtime/library/library.js b/airtime_mvc/public/js/airtime/library/library.js index 3fea72940..70bf2744b 100644 --- a/airtime_mvc/public/js/airtime/library/library.js +++ b/airtime_mvc/public/js/airtime/library/library.js @@ -138,10 +138,10 @@ var AIRTIME = (function(AIRTIME) { } if (check === true) { - AIRTIME.button.enableButton("btn-group #sb-trash", true); + AIRTIME.button.enableButton("btn-group #sb-trash", false); } else { - AIRTIME.button.disableButton("btn-group #sb-trash", true); + AIRTIME.button.disableButton("btn-group #sb-trash", false); } }; diff --git a/airtime_mvc/public/js/airtime/showbuilder/builder.js b/airtime_mvc/public/js/airtime/showbuilder/builder.js index 1282e6ca5..b280460bd 100644 --- a/airtime_mvc/public/js/airtime/showbuilder/builder.js +++ b/airtime_mvc/public/js/airtime/showbuilder/builder.js @@ -962,16 +962,16 @@ var AIRTIME = (function(AIRTIME){ "" + "") .append("
" + - "
") .append("
" + - "
") .append("
" + - "
") .append("
" + - "
"); $toolbar.append($menu); @@ -987,7 +987,7 @@ var AIRTIME = (function(AIRTIME){ data, msg = 'Cancel Current Show?'; - if (AIRTIME.button.isDisabled('icon-ban-circle') === true) { + if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) { return; } @@ -1018,7 +1018,7 @@ var AIRTIME = (function(AIRTIME){ $toolbar.find('.icon-step-forward').parent() .click(function() { - if (AIRTIME.button.isDisabled('icon-step-forward') === true) { + if (AIRTIME.button.isDisabled('icon-step-forward', true) === true) { return; } @@ -1032,10 +1032,10 @@ var AIRTIME = (function(AIRTIME){ }); //delete overbooked tracks. - $toolbar.find('.icon-cut').parent() + $toolbar.find('.icon-cut', true).parent() .click(function() { - if (AIRTIME.button.isDisabled('icon-cut') === true) { + if (AIRTIME.button.isDisabled('icon-cut', true) === true) { return; } @@ -1055,7 +1055,7 @@ var AIRTIME = (function(AIRTIME){ $toolbar.find('.icon-trash').parent() .click(function() { - if (AIRTIME.button.isDisabled('icon-trash') === true) { + if (AIRTIME.button.isDisabled('icon-trash', true) === true) { return; }