CC-4466: Buttons on Now Playing page are clickable even though they are disabled

-fixed
This commit is contained in:
denise 2012-09-18 10:53:19 -04:00
parent aa3bf3941b
commit 1698aae251
5 changed files with 21 additions and 16 deletions

View File

@ -6,8 +6,11 @@ var AIRTIME = (function(AIRTIME) {
} }
mod = AIRTIME.button; mod = AIRTIME.button;
mod.isDisabled = function(c) { mod.isDisabled = function(c, useParent) {
var button = $("." + c); var button = $("." + c);
if (useParent) {
button = button.parent();
}
if (button.hasClass(DISABLED_CLASS)) { if (button.hasClass(DISABLED_CLASS)) {
return true; return true;
@ -25,6 +28,7 @@ var AIRTIME = (function(AIRTIME) {
if (button.hasClass(DISABLED_CLASS)) { if (button.hasClass(DISABLED_CLASS)) {
button.removeClass(DISABLED_CLASS); button.removeClass(DISABLED_CLASS);
button.removeAttr('disabled');
} }
}; };
@ -37,6 +41,7 @@ var AIRTIME = (function(AIRTIME) {
if (!button.hasClass(DISABLED_CLASS)) { if (!button.hasClass(DISABLED_CLASS)) {
button.addClass(DISABLED_CLASS); button.addClass(DISABLED_CLASS);
button.attr('disabled', 'disabled');
} }
}; };

View File

@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("btn-group #library-plus", true); AIRTIME.button.enableButton("btn-group #library-plus", false);
} else { } else {
AIRTIME.button.disableButton("btn-group #library-plus", true); AIRTIME.button.disableButton("btn-group #library-plus", false);
} }
}; };

View File

@ -16,9 +16,9 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("btn-group #library-plus", true); AIRTIME.button.enableButton("btn-group #library-plus", false);
} else { } else {
AIRTIME.button.disableButton("btn-group #library-plus", true); AIRTIME.button.disableButton("btn-group #library-plus", false);
} }
}; };

View File

@ -138,10 +138,10 @@ var AIRTIME = (function(AIRTIME) {
} }
if (check === true) { if (check === true) {
AIRTIME.button.enableButton("btn-group #sb-trash", true); AIRTIME.button.enableButton("btn-group #sb-trash", false);
} }
else { else {
AIRTIME.button.disableButton("btn-group #sb-trash", true); AIRTIME.button.disableButton("btn-group #sb-trash", false);
} }
}; };

View File

@ -962,16 +962,16 @@ var AIRTIME = (function(AIRTIME){
"</ul>" + "</ul>" +
"</div>") "</div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove overbooked tracks' class='ui-state-disabled btn btn-small'>" + "<button title='Remove overbooked tracks' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-cut'></i></button></div>") "<i class='icon-white icon-cut'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small'>" + "<button title='Remove selected scheduled items' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-trash'></i></button></div>") "<i class='icon-white icon-trash'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small'>" + "<button title='Jump to the current playing track' class='ui-state-disabled btn btn-small' disabled='disabled'>" +
"<i class='icon-white icon-step-forward'></i></button></div>") "<i class='icon-white icon-step-forward'></i></button></div>")
.append("<div class='btn-group'>" + .append("<div class='btn-group'>" +
"<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger'>" + "<button title='Cancel current show' class='ui-state-disabled btn btn-small btn-danger' disabled='disabled'>" +
"<i class='icon-white icon-ban-circle'></i></button></div>"); "<i class='icon-white icon-ban-circle'></i></button></div>");
$toolbar.append($menu); $toolbar.append($menu);
@ -987,7 +987,7 @@ var AIRTIME = (function(AIRTIME){
data, data,
msg = 'Cancel Current Show?'; msg = 'Cancel Current Show?';
if (AIRTIME.button.isDisabled('icon-ban-circle') === true) { if (AIRTIME.button.isDisabled('icon-ban-circle', true) === true) {
return; return;
} }
@ -1018,7 +1018,7 @@ var AIRTIME = (function(AIRTIME){
$toolbar.find('.icon-step-forward').parent() $toolbar.find('.icon-step-forward').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-step-forward') === true) { if (AIRTIME.button.isDisabled('icon-step-forward', true) === true) {
return; return;
} }
@ -1032,10 +1032,10 @@ var AIRTIME = (function(AIRTIME){
}); });
//delete overbooked tracks. //delete overbooked tracks.
$toolbar.find('.icon-cut').parent() $toolbar.find('.icon-cut', true).parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-cut') === true) { if (AIRTIME.button.isDisabled('icon-cut', true) === true) {
return; return;
} }
@ -1055,7 +1055,7 @@ var AIRTIME = (function(AIRTIME){
$toolbar.find('.icon-trash').parent() $toolbar.find('.icon-trash').parent()
.click(function() { .click(function() {
if (AIRTIME.button.isDisabled('icon-trash') === true) { if (AIRTIME.button.isDisabled('icon-trash', true) === true) {
return; return;
} }