Skip to content

Commit

Permalink
Update JSHint config and clean up warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyvercher committed Mar 31, 2016
1 parent d2b7d04 commit 775ad72
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 29 deletions.
33 changes: 15 additions & 18 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
{
"boss": true,
"browser": true,
"curly": true,
"devel": true,
"eqeqeq": true,
"eqnull": true,
"expr": true,
"immed": true,
"boss": true,
"curly": true,
"eqeqeq": true,
"eqnull": true,
"immed": true,
"latedef": "nofunc",
"newcap": true,
"noarg": true,
"quotmark": "single",
"sub": true,
"undef": true,
"unused": "vars",

"browser": true,
"jquery": true,
"latedef": true,
"newcap": true,
"noarg": true,
"node": true,
"quotmark": "single",
"smarttabs": true,
"sub": true,
"trailing": true,
"undef": true,

"globals": {
"atmep": false,
"MediaElementPlayer": false,
"mejs": false
}
Expand Down
17 changes: 12 additions & 5 deletions dist/jquery.cue.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ window.cue = window.cue || {};
}).trigger( 'resize.cue' );
}

// Hide the duration and time separator if the duration isn't available.
if ( isNaN( media.duration ) ) {
player.container.find( '.mejs-time-separator, .mejs-duration' ).hide();
}

$media.on( 'play.cue', function() {
$container.addClass( 'is-playing' );
}).on( 'pause.cue', function() {
Expand Down Expand Up @@ -226,7 +231,7 @@ window.cue = window.cue || {};
* Proxied MediaElementPlayer success callback.
*/
historySuccess = function( media, domObject, player ) {
var isPlaying, status, volume,
var isPlaying, status,
history = new History( player.options.cueId || '', player.options.cueSignature || '' ),
autoplay = ( 'autoplay' === media.getAttribute( 'autoplay' ) ),
mf = mejs.MediaFeatures;
Expand Down Expand Up @@ -260,7 +265,6 @@ window.cue = window.cue || {};

buildcuehistory: function( player, controls, layers, media ) {
var currentTime, history,
$container = player.container.closest( player.options.cueSelectors.playlist ),
isLoaded = false,
mf = mejs.MediaFeatures,
isSafari = /Safari/.test( navigator.userAgent ) && /Apple Computer/.test( navigator.vendor );
Expand Down Expand Up @@ -446,8 +450,7 @@ window.cue = window.cue || {};
buildcueplaylist: function( player, controls, layers, media ) {
var selectors = player.options.cueSelectors,
$media = $( media ),
$playlist = player.container.closest( selectors.playlist ),
$tracks = $playlist.find( selectors.track );
$playlist = player.container.closest( selectors.playlist );

player.cueSetupTracklist();

Expand Down Expand Up @@ -480,7 +483,11 @@ window.cue = window.cue || {};

if ( player.cueCurrentTrack === index && '' !== player.options.cuePlaylistTracks[ index ].src ) {
// Toggle play/pause state.
media.paused ? media.play() : media.pause();
if ( media.paused) {
media.play();
} else {
media.pause();
}
} else {
player.cueSetCurrentTrack( index );
}
Expand Down
Loading

0 comments on commit 775ad72

Please sign in to comment.