Created
September 21, 2015 10:25
-
-
Save steffentchr/dcc2d64ec65ea3082918 to your computer and use it in GitHub Desktop.
Player: Add a class to <body> for the current channel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Player.bind('player:video:loaded', function(e,video){ | |
var body = $('body'); | |
$.each(body.attr('class').split(' '), function(i,className){ | |
if(/^album-\d+$/.test(className)) body.removeClass(className); | |
}); | |
$.each(video.album_id.split(' '), function(i,id){ | |
body.addClass('album-'+id); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment