CC-4246: Smart Playlist: Click shuffle button will shuffle the contents multiple times
-fixed -disabled shuffle button
This commit is contained in:
parent
82f2b2e7c3
commit
5f1c6453a5
|
@ -329,23 +329,16 @@ function setupUI() {
|
||||||
if (shuffleButton.hasClass('ui-state-disabled')) {
|
if (shuffleButton.hasClass('ui-state-disabled')) {
|
||||||
shuffleButton.removeClass('ui-state-disabled');
|
shuffleButton.removeClass('ui-state-disabled');
|
||||||
}
|
}
|
||||||
//check if shuffle button already has a click event
|
if (shuffleButton.attr('disabled') !== undefined) {
|
||||||
var clickEvents = $(document).data('events').click;
|
shuffleButton.removeAttr('disabled');
|
||||||
var hasEvent = false;
|
|
||||||
$.each(clickEvents, function(i, event) {
|
|
||||||
if (event.selector == shuffleButton.selector) {
|
|
||||||
hasEvent = true;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (!hasEvent) {
|
|
||||||
shuffleButton.live('click', function(){
|
|
||||||
buttonClickAction('shuffle', 'Playlist/smart-block-shuffle');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
} else if (!shuffleButton.hasClass('ui-state-disabled')) {
|
} else if (!shuffleButton.hasClass('ui-state-disabled')) {
|
||||||
shuffleButton.addClass('ui-state-disabled');
|
if (!shuffleButton.hasClass('ui-state-disabled')) {
|
||||||
shuffleButton.die('click');
|
shuffleButton.addClass('ui-state-disabled');
|
||||||
|
}
|
||||||
|
if (shuffleButton.attr('disabled') === undefined) {
|
||||||
|
shuffleButton.attr('disabled', 'disabled');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var dynamic_length = target_length;
|
var dynamic_length = target_length;
|
||||||
|
|
Loading…
Reference in New Issue