Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

scriptLoaded is now an actual jQuery Deferred, rather than a query, w…

…hich was causing a bug whereby no visuals would appear alongside the audio sometimes.
  • Loading branch information...
commit 2ed5cd4cb670d0bdaccc2899477766c530f56a04 1 parent 55a1459
Atul Varma toolness authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 static-files/play-script.js
5 static-files/play-script.js
View
@@ -1,6 +1,7 @@
$(window).ready(function() {
- var scriptLoaded = $("#script").load("script.html");
+ var scriptLoaded = jQuery.Deferred();
var durationsLoaded = jQuery.getJSON("script.json");
+ $("#script").load("script.html", function() { scriptLoaded.resolve(); });
$("#subtitle-toggle").click(function() {
$("#subtitle").fadeToggle();
if ($(this).text() == "Show subtitles")
@@ -8,7 +9,7 @@ $(window).ready(function() {
else
$(this).text("Show subtitles")
});
- jQuery.when(durationsLoaded, scriptLoaded).then(function(durations) {
+ jQuery.when(durationsLoaded, scriptLoaded).done(function(durations) {
var i = 0;
var currTime = 0;
var currVisual = null;
Please sign in to comment.
Something went wrong with that request. Please try again.