2016-05-11 07:36:28 -07:00
|
|
|
|
define(['components/remotecontrol'], function (remotecontrolFactory) {
|
2014-04-27 15:51:07 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
return function (view, params) {
|
2014-04-27 15:51:07 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
var self = this;
|
2014-04-27 15:51:07 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
var remoteControl = new remotecontrolFactory();
|
|
|
|
|
remoteControl.init(view, view.querySelector('.remoteControlContent'));
|
2015-03-17 21:09:31 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
view.addEventListener('viewbeforeshow', function (e) {
|
|
|
|
|
document.body.classList.add('hiddenViewMenuBar');
|
|
|
|
|
document.body.classList.add('hiddenNowPlayingBar');
|
2015-09-26 07:56:11 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
if (remoteControl) {
|
|
|
|
|
remoteControl.onShow();
|
2016-02-05 19:47:06 -07:00
|
|
|
|
}
|
2016-05-11 07:36:28 -07:00
|
|
|
|
});
|
2014-04-27 15:51:07 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
view.addEventListener('viewbeforehide', function (e) {
|
2014-05-09 12:43:06 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
if (remoteControl) {
|
|
|
|
|
remoteControl.destroy();
|
|
|
|
|
}
|
2014-05-09 12:43:06 -07:00
|
|
|
|
|
2016-05-11 07:36:28 -07:00
|
|
|
|
document.body.classList.remove('hiddenViewMenuBar');
|
|
|
|
|
document.body.classList.remove('hiddenNowPlayingBar');
|
|
|
|
|
});
|
|
|
|
|
};
|
2014-05-08 21:38:12 -07:00
|
|
|
|
|
2016-03-18 21:26:17 -07:00
|
|
|
|
});
|