|
7 | 7 | * http://www.opensource.org/licenses/MIT
|
8 | 8 | *
|
9 | 9 | * Author: Mark J Panaghiston
|
10 |
| - * Version: 2.3.1 |
| 10 | + * Version: 2.3.2 |
11 | 11 | * Date: 8th June 2014
|
12 | 12 | *
|
13 | 13 | * Requires:
|
|
44 | 44 | self.previous();
|
45 | 45 | }
|
46 | 46 | }
|
| 47 | + }, |
| 48 | + stateClass: { |
| 49 | + shuffled: "jp-state-shuffled" |
47 | 50 | }
|
48 | 51 | }, this._options, options); // Object: The jPlayer constructor options for this playlist and the playlist options
|
49 | 52 |
|
|
94 | 97 |
|
95 | 98 | // The blur function executes in the context of the click handler
|
96 | 99 | var blur = function() {
|
97 |
| - if($(this.cssSelector.jPlayer).jPlayer("option", "autoBlur")) { |
| 100 | + if($(self.cssSelector.jPlayer).jPlayer("option", "autoBlur")) { |
98 | 101 | $(this).blur();
|
99 | 102 | }
|
100 | 103 | };
|
|
114 | 117 |
|
115 | 118 | $(this.cssSelector.shuffle).click(function(e) {
|
116 | 119 | e.preventDefault();
|
117 |
| - self.shuffle(true); |
| 120 | + if(self.shuffled && $(self.cssSelector.jPlayer).jPlayer("option", "useStateClassSkin")) { |
| 121 | + self.shuffle(false); |
| 122 | + } else { |
| 123 | + self.shuffle(true); |
| 124 | + } |
118 | 125 | blur.call(this);
|
119 | 126 | });
|
120 | 127 | $(this.cssSelector.shuffleOff).click(function(e) {
|
|
308 | 315 | } else {
|
309 | 316 | $(this.cssSelector.playlist + " ." + this.options.playlistOptions.removeItemClass).hide();
|
310 | 317 | }
|
| 318 | + |
311 | 319 | if(this.shuffled) {
|
312 |
| - $(this.cssSelector.shuffleOff).show(); |
313 |
| - $(this.cssSelector.shuffle).hide(); |
| 320 | + $(this.cssSelector.jPlayer).jPlayer("addStateClass", "shuffled"); |
314 | 321 | } else {
|
315 |
| - $(this.cssSelector.shuffleOff).hide(); |
316 |
| - $(this.cssSelector.shuffle).show(); |
| 322 | + $(this.cssSelector.jPlayer).jPlayer("removeStateClass", "shuffled"); |
| 323 | + } |
| 324 | + if($(this.cssSelector.shuffle).length && $(this.cssSelector.shuffleOff).length) { |
| 325 | + if(this.shuffled) { |
| 326 | + $(this.cssSelector.shuffleOff).show(); |
| 327 | + $(this.cssSelector.shuffle).hide(); |
| 328 | + } else { |
| 329 | + $(this.cssSelector.shuffleOff).hide(); |
| 330 | + $(this.cssSelector.shuffle).show(); |
| 331 | + } |
317 | 332 | }
|
318 | 333 | },
|
319 | 334 | _highlight: function(index) {
|
|
0 commit comments