Skip to content

Commit

Permalink
Merge pull request #1584 from Camc314/migrate-to-ES6-29
Browse files Browse the repository at this point in the history
Migration of nowplaying and videoosd to ES6 modules
  • Loading branch information
dkanada committed Jul 23, 2020
2 parents 9b7d7e4 + eb7d8fa commit 03ef599
Show file tree
Hide file tree
Showing 3 changed files with 201 additions and 176 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@
"src/components/syncPlay/timeSyncManager.js",
"src/controllers/dashboard/logs.js",
"src/controllers/dashboard/plugins/repositories.js",
"src/controllers/playback/nowplaying.js",
"src/controllers/playback/videoosd.js",
"src/controllers/user/display.js",
"src/controllers/user/home.js",
"src/controllers/user/playback.js",
Expand Down
38 changes: 19 additions & 19 deletions src/controllers/playback/nowplaying.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
define(['components/remotecontrol/remotecontrol', 'libraryMenu', 'emby-button'], function (remotecontrolFactory, libraryMenu) {
'use strict';
import remotecontrolFactory from 'components/remotecontrol/remotecontrol';
import libraryMenu from 'libraryMenu';
import 'emby-button';

return function (view, params) {
var remoteControl = new remotecontrolFactory();
remoteControl.init(view, view.querySelector('.remoteControlContent'));
view.addEventListener('viewshow', function (e) {
libraryMenu.setTransparentMenu(true);
export default function (view, params) {
const remoteControl = new remotecontrolFactory();
remoteControl.init(view, view.querySelector('.remoteControlContent'));
view.addEventListener('viewshow', function (e) {
libraryMenu.setTransparentMenu(true);

if (remoteControl) {
remoteControl.onShow();
}
});
view.addEventListener('viewbeforehide', function (e) {
libraryMenu.setTransparentMenu(false);
if (remoteControl) {
remoteControl.onShow();
}
});
view.addEventListener('viewbeforehide', function (e) {
libraryMenu.setTransparentMenu(false);

if (remoteControl) {
remoteControl.destroy();
}
});
};
});
if (remoteControl) {
remoteControl.destroy();
}
});
}
Loading

0 comments on commit 03ef599

Please sign in to comment.