2014-04-27 15:51:07 -07:00
|
|
|
|
(function (window, document, $, setTimeout, clearTimeout) {
|
|
|
|
|
|
2015-09-08 10:06:38 -07:00
|
|
|
|
pageIdOn('pageinit', "nowPlayingPage", function () {
|
2014-04-27 15:51:07 -07:00
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2016-02-05 19:47:06 -07: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 07:51:26 -07:00
|
|
|
|
});
|
2015-09-08 10:06:38 -07:00
|
|
|
|
});
|
2016-02-05 19:47:06 -07:00
|
|
|
|
|
2015-09-08 10:06:38 -07:00
|
|
|
|
pageIdOn('pagebeforeshow', "nowPlayingPage", function () {
|
2014-04-28 20:56:20 -07:00
|
|
|
|
|
|
|
|
|
var page = this;
|
|
|
|
|
|
2016-02-05 19:47:06 -07:00
|
|
|
|
document.body.classList.add('hiddenViewMenuBar');
|
|
|
|
|
document.body.classList.add('hiddenNowPlayingBar');
|
2015-03-17 21:09:31 -07:00
|
|
|
|
|
2016-02-05 19:47:06 -07:00
|
|
|
|
if (page.remoteControl) {
|
2015-09-26 07:56:11 -07:00
|
|
|
|
|
2016-02-05 19:47:06 -07:00
|
|
|
|
if (!page.remoteControlInitComplete) {
|
|
|
|
|
page.remoteControlInitComplete = true;
|
|
|
|
|
} else {
|
|
|
|
|
page.remoteControl.onShow();
|
|
|
|
|
}
|
2015-09-26 07:56:11 -07:00
|
|
|
|
}
|
2014-04-27 15:51:07 -07:00
|
|
|
|
});
|
|
|
|
|
|
2016-02-05 19:47:06 -07:00
|
|
|
|
pageIdOn('pagebeforehide', "nowPlayingPage", function () {
|
2014-05-09 12:43:06 -07:00
|
|
|
|
|
2016-02-05 19:47:06 -07:00
|
|
|
|
var page = this;
|
2014-05-09 12:43:06 -07:00
|
|
|
|
|
2016-02-05 19:47:06 -07:00
|
|
|
|
if (page.remoteControl) {
|
|
|
|
|
page.remoteControl.destroy();
|
2014-05-08 21:38:12 -07:00
|
|
|
|
}
|
2016-02-05 19:47:06 -07:00
|
|
|
|
document.body.classList.remove('hiddenViewMenuBar');
|
|
|
|
|
document.body.classList.remove('hiddenNowPlayingBar');
|
|
|
|
|
});
|
2014-05-08 21:38:12 -07:00
|
|
|
|
|
2014-04-27 15:51:07 -07:00
|
|
|
|
})(window, document, jQuery, setTimeout, clearTimeout);
|