提交 4f8087d6 编写于 作者: M Mike Greiling

refactor _this usage into proper function binding

上级 a6ed18cc
......@@ -25,13 +25,11 @@
this.hideReferencedUsers(form);
} else {
preview.text('Loading...');
this.renderMarkdown(mdText, (function(_this) {
return function(response) {
preview.html(response.body);
preview.renderGFM();
_this.renderReferencedUsers(response.references.users, form);
};
})(this));
this.renderMarkdown(mdText, (function(response) {
preview.html(response.body);
preview.renderGFM();
this.renderReferencedUsers(response.references.users, form);
}).bind(this));
}
};
......@@ -50,15 +48,13 @@
text: text
},
dataType: 'json',
success: (function(_this) {
return function(response) {
_this.ajaxCache = {
text: text,
response: response
};
success(response);
success: (function(response) {
this.ajaxCache = {
text: text,
response: response
};
})(this)
success(response);
}).bind(this)
});
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册