Platform add body classes

This commit is contained in:
Max Lynch
2015-05-05 13:50:54 -05:00
parent 296985976d
commit eac1ef7508
8 changed files with 33 additions and 17 deletions

View File

@ -29,6 +29,8 @@ class PlatformController {
set(platform) {
activePlatform = platform;
this._applyBodyClasses();
}
setDefault(platform) {
@ -49,6 +51,16 @@ class PlatformController {
}
return null;
}
_applyBodyClasses() {
if(!activePlatform) {
return;
}
util.dom.raf(() => {
document.body.classList.add('platform-' + activePlatform.name);
});
}
}
export let Platform = new PlatformController();