diff --git a/js/adapt-contrib-spoor.js b/js/adapt-contrib-spoor.js index 9b11c5b5..cb4ec465 100644 --- a/js/adapt-contrib-spoor.js +++ b/js/adapt-contrib-spoor.js @@ -98,7 +98,7 @@ define([ advancedSettings._commitOnVisibilityChangeHidden !== false) && document.addEventListener; - this._onWindowUnload = _.bind(this.onWindowUnload, this); + this._onWindowUnload = this.onWindowUnload.bind(this); $(window).on('beforeunload unload', this._onWindowUnload); if (shouldCommitOnVisibilityChange) { diff --git a/js/adapt-stateful-session.js b/js/adapt-stateful-session.js index 1bbb63ba..536dd42f 100644 --- a/js/adapt-stateful-session.js +++ b/js/adapt-stateful-session.js @@ -15,18 +15,18 @@ define([ // Session Begin initialize: function(callback) { - this._onWindowUnload = _.bind(this.onWindowUnload, this); + this._onWindowUnload = this.onWindowUnload.bind(this); this.getConfig(); this.getLearnerInfo(); // Restore state asynchronously to prevent IE8 freezes - this.restoreSessionState(_.bind(function() { + this.restoreSessionState(function() { // still need to defer call because AdaptModel.check*Status functions are asynchronous - _.defer(_.bind(this.setupEventListeners, this)); + _.defer(this.setupEventListeners.bind(this)); callback(); - }, this)); + }.bind(this)); }, getConfig: function() { @@ -61,12 +61,12 @@ define([ var sessionPairs = Adapt.offlineStorage.get(); var hasNoPairs = _.keys(sessionPairs).length === 0; - var doSynchronousPart = _.bind(function() { + var doSynchronousPart = function() { if (sessionPairs.questions && this._shouldStoreResponses) questions.deserialize(sessionPairs.questions); if (sessionPairs._isCourseComplete) Adapt.course.set('_isComplete', sessionPairs._isCourseComplete); if (sessionPairs._isAssessmentPassed) Adapt.course.set('_isAssessmentPassed', sessionPairs._isAssessmentPassed); callback(); - }, this); + }.bind(this); if (hasNoPairs) return callback(); diff --git a/js/scorm/wrapper.js b/js/scorm/wrapper.js index 811a736a..934f98d2 100644 --- a/js/scorm/wrapper.js +++ b/js/scorm/wrapper.js @@ -448,7 +448,7 @@ define (function(require) { if(this.timedCommitFrequency > 0) { var delay = this.timedCommitFrequency * (60 * 1000); - this.timedCommitIntervalID = window.setInterval(_.bind(this.commit, this), delay); + this.timedCommitIntervalID = window.setInterval(this.commit.bind(this), delay); } }; @@ -457,7 +457,7 @@ define (function(require) { this.commitRetryPending = true;// stop anything else from calling commit until this is done - this.retryCommitTimeoutID = window.setTimeout(_.bind(this.doRetryCommit, this), this.commitRetryDelay); + this.retryCommitTimeoutID = window.setTimeout(this.doRetryCommit.bind(this), this.commitRetryDelay); }; ScormWrapper.prototype.doRetryCommit = function() {