diff options
author | Teddy Wing | 2020-05-05 23:03:38 +0200 |
---|---|---|
committer | Teddy Wing | 2020-05-05 23:06:13 +0200 |
commit | 0c56f4361c836f15d22daf7ce70570f9f95afdae (patch) | |
tree | 34f89b1ad4cc9a23ece4abd5ef976381f3567cb6 /src | |
parent | e1383d531a4c3eb4d83e500aad09f92967abd395 (diff) | |
download | netflix-immersive-0c56f4361c836f15d22daf7ce70570f9f95afdae.tar.bz2 |
Move fullscreen credits init function to fullscreen_credits.ts
Makes more sense to put it in the fullscreen_credits module.
Diffstat (limited to 'src')
-rw-r--r-- | src/fullscreen_credits.ts | 10 | ||||
-rw-r--r-- | src/index.ts | 7 |
2 files changed, 10 insertions, 7 deletions
diff --git a/src/fullscreen_credits.ts b/src/fullscreen_credits.ts index a569fa2..6d174ed 100644 --- a/src/fullscreen_credits.ts +++ b/src/fullscreen_credits.ts @@ -1,4 +1,4 @@ -export function with_player (callback) { +function with_player (callback) { var interval = setInterval( function() { var player = document.querySelector('.NFPlayer.nf-player-container'); @@ -13,7 +13,7 @@ export function with_player (callback) { ); } -export function init_mutation_observer (player) { +function init_mutation_observer (player) { var observer = new MutationObserver(function(mutation_list) { for (var i = 0; i < mutation_list.length; i++) { var mutation = mutation_list[i]; @@ -58,3 +58,9 @@ export function init_mutation_observer (player) { } ); } + +export default function init () { + with_player(function(player) { + init_mutation_observer(player); + }); +} diff --git a/src/index.ts b/src/index.ts index 1ea3d28..504a7d7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,9 +1,6 @@ -import { init_mutation_observer, with_player } from './fullscreen_credits'; +import fullscreen_credits from './fullscreen_credits'; import { styles } from './styles'; -with_player(function(player) { - init_mutation_observer(player); -}); - +fullscreen_credits(); styles(); |