2014-04-27 18:51:07 -04:00
|
|
|
|
(function (window, document, $, setTimeout, clearTimeout) {
|
|
|
|
|
|
2015-09-08 13:06:38 -04:00
|
|
|
|
pageIdOn('pageinit', "nowPlayingPage", function () {
|
2014-04-27 18:51:07 -04:00
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
require(['components/remotecontrol'], function (remotecontrolFactory) {
|
|
|
|
|
page.remoteControl = new remotecontrolFactory();
|
|
|
|
|
page.remoteControl.init(page.querySelector('.remoteControlContent'));
|
|
|
|
|
page.remoteControl.onShow();
|
|
|
|
|
page.remoteControlInitComplete = true;
|
2015-09-26 10:51:26 -04:00
|
|
|
|
});
|
2015-09-08 13:06:38 -04:00
|
|
|
|
});
|
2016-02-05 21:47:06 -05:00
|
|
|
|
|
2015-09-08 13:06:38 -04:00
|
|
|
|
pageIdOn('pagebeforeshow', "nowPlayingPage", function () {
|
2014-04-28 23:56:20 -04:00
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
document.body.classList.add('hiddenViewMenuBar');
|
|
|
|
|
document.body.classList.add('hiddenNowPlayingBar');
|
2015-03-18 00:09:31 -04:00
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
if (page.remoteControl) {
|
2015-09-26 10:56:11 -04:00
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
if (!page.remoteControlInitComplete) {
|
|
|
|
|
page.remoteControlInitComplete = true;
|
|
|
|
|
} else {
|
|
|
|
|
page.remoteControl.onShow();
|
|
|
|
|
}
|
2015-09-26 10:56:11 -04:00
|
|
|
|
}
|
2014-04-27 18:51:07 -04:00
|
|
|
|
});
|
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
pageIdOn('pagebeforehide', "nowPlayingPage", function () {
|
2014-05-09 15:43:06 -04:00
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
var page = this;
|
2014-05-09 15:43:06 -04:00
|
|
|
|
|
2016-02-05 21:47:06 -05:00
|
|
|
|
if (page.remoteControl) {
|
|
|
|
|
page.remoteControl.destroy();
|
2014-05-09 00:38:12 -04:00
|
|
|
|
}
|
2016-02-05 21:47:06 -05:00
|
|
|
|
document.body.classList.remove('hiddenViewMenuBar');
|
|
|
|
|
document.body.classList.remove('hiddenNowPlayingBar');
|
|
|
|
|
});
|
2014-05-09 00:38:12 -04:00
|
|
|
|
|
2014-04-27 18:51:07 -04:00
|
|
|
|
})(window, document, jQuery, setTimeout, clearTimeout);
|