提交 95d53592 编写于 作者: K Kushal Pandya

ESLint: use outer `this` by currying function

上级 ad0b8187
......@@ -81,19 +81,20 @@
};
Build.prototype.getInitialBuildTrace = function() {
var _this = this;
var removeRefreshStatuses = ['success', 'failed', 'canceled', 'skipped']
return $.ajax({
url: this.buildUrl,
dataType: 'json',
success: function(buildData) {
$('.js-build-output').html(buildData.trace_html);
if (removeRefreshStatuses.indexOf(buildData.status) >= 0) {
_this.initScrollMonitor();
return $('.js-build-refresh').remove();
}
}
success: (function(_this) {
return function(buildData) {
$('.js-build-output').html(buildData.trace_html);
if (removeRefreshStatuses.indexOf(buildData.status) >= 0) {
_this.initScrollMonitor();
return $('.js-build-refresh').remove();
}
};
})(this)
});
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册