Index: includes/scripts/initialize-videos.html |
=================================================================== |
new file mode 100644 |
--- /dev/null |
+++ b/includes/scripts/initialize-videos.html |
@@ -0,0 +1,7 @@ |
+<script> |
+ document.addEventListener("DOMContentLoaded", function(event) |
ire
2018/02/21 09:11:29
Why have this in a separate file? We can check for
juliandoucette
2018/02/21 10:35:18
I prefer to define a class/module in one file and
ire
2018/02/22 09:25:41
(Forgot to say that this is a NIT)
Is there ever
juliandoucette
2018/02/23 13:31:07
I take your point. Thank you for explaining / push
ire
2018/02/26 18:33:18
You're welcome :)
|
+ { |
+ window.videos = [].slice.call(document.querySelectorAll(".video-parent")) |
+ .map(function(parent) {return new Video(parent);}); |
+ }); |
+</script> |