refactor _this usage into proper function binding
This commit is contained in:
parent
a6ed18cc71
commit
4f8087d62b
1 changed files with 11 additions and 15 deletions
|
@ -25,13 +25,11 @@
|
||||||
this.hideReferencedUsers(form);
|
this.hideReferencedUsers(form);
|
||||||
} else {
|
} else {
|
||||||
preview.text('Loading...');
|
preview.text('Loading...');
|
||||||
this.renderMarkdown(mdText, (function(_this) {
|
this.renderMarkdown(mdText, (function(response) {
|
||||||
return function(response) {
|
preview.html(response.body);
|
||||||
preview.html(response.body);
|
preview.renderGFM();
|
||||||
preview.renderGFM();
|
this.renderReferencedUsers(response.references.users, form);
|
||||||
_this.renderReferencedUsers(response.references.users, form);
|
}).bind(this));
|
||||||
};
|
|
||||||
})(this));
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -50,15 +48,13 @@
|
||||||
text: text
|
text: text
|
||||||
},
|
},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: (function(_this) {
|
success: (function(response) {
|
||||||
return function(response) {
|
this.ajaxCache = {
|
||||||
_this.ajaxCache = {
|
text: text,
|
||||||
text: text,
|
response: response
|
||||||
response: response
|
|
||||||
};
|
|
||||||
success(response);
|
|
||||||
};
|
};
|
||||||
})(this)
|
success(response);
|
||||||
|
}).bind(this)
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue