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