From: Scott Worley Date: Wed, 21 May 2014 06:49:15 +0000 (-0700) Subject: Use bind X-Git-Url: http://git.scottworley.com/nt3d/commitdiff_plain/1df99269ed4f25d4e70389ba70337ca62a545a5c?hp=88dc31f49b9a356855456a1e182d88f284430c96 Use bind --- diff --git a/nt3d.js b/nt3d.js index bc11c71..d4e62f6 100644 --- a/nt3d.js +++ b/nt3d.js @@ -418,7 +418,7 @@ nt3d = { // Continue in a callback, so that there's not a stale download // link hanging around while we process. - setTimeout(function(the_this) { (function() { + setTimeout(function() { // Get params from form var params = []; @@ -446,7 +446,7 @@ nt3d = { this.ui.appendChild(download_link); setTimeout(function() { download_link.setAttribute("style", "-webkit-transition: background-color 0.4s; -moz-transition: background-color 0.4s; -o-transition: background-color 0.4s; -ms-transition: background-color 0.4s; transition: background-color 0.4s; background-color: inherit"); }, 0); - }).call(the_this); }, 0, this); // (We were in a callback this whole time, remember?) + }.bind(this), 0); // (We were in a callback this whole time, remember?) }, framework: function (f, params) { this.user_function = f;