CC-4466: Buttons on Now Playing page are clickable even though they are disabled
-fixed
This commit is contained in:
parent
aa3bf3941b
commit
1698aae251
|
@ -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');
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -962,16 +962,16 @@ var AIRTIME = (function(AIRTIME){
|
|||
"</ul>" +
|
||||
"</div>")
|
||||
.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>")
|
||||
.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>")
|
||||
.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>")
|
||||
.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>");
|
||||
|
||||
$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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue