Last active
December 21, 2015 21:09
-
-
Save megoth/6366513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function (scope, element) { | |
function iframeSetup(frameRef) { | |
var iframe = frameRef.contentWindow ? frameRef.contentWindow.document : frameRef.contentDocument; | |
var finished = iframe.getElementById("ExerciseComplete") != null; | |
if (finished) { | |
scope.$emit("checkboxSurveyCompleted", scope.uriToExercises); | |
return; | |
} | |
var paused = iframe.getElementById("ExercisePaused") != null; // bogus ID, must be replaced with something that actually is used in checkbox | |
if (paused) { | |
scope.$emit("checkboxSurveyPaused", scope.uriToExercises); | |
return; | |
} | |
} | |
element.on("load", function () { | |
iframeSetup(this); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment