2017-01-17 11:00:19 -07:00
|
|
|
|
define(['components/remotecontrol', 'emby-button'], function (remotecontrolFactory) {
|
2016-10-22 22:11:46 -07:00
|
|
|
|
'use strict';
|
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
|
|
|
|
});
|