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')) {
|
||||
shuffleButton.removeClass('ui-state-disabled');
|
||||
}
|
||||
//check if shuffle button already has a click event
|
||||
var clickEvents = $(document).data('events').click;
|
||||
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');
|
||||
});
|
||||
if (shuffleButton.attr('disabled') !== undefined) {
|
||||
shuffleButton.removeAttr('disabled');
|
||||
}
|
||||
} else if (!shuffleButton.hasClass('ui-state-disabled')) {
|
||||
shuffleButton.addClass('ui-state-disabled');
|
||||
shuffleButton.die('click');
|
||||
if (!shuffleButton.hasClass('ui-state-disabled')) {
|
||||
shuffleButton.addClass('ui-state-disabled');
|
||||
}
|
||||
if (shuffleButton.attr('disabled') === undefined) {
|
||||
shuffleButton.attr('disabled', 'disabled');
|
||||
}
|
||||
}
|
||||
|
||||
var dynamic_length = target_length;
|
||||
|
|
Loading…
Reference in New Issue