Change normal function in to a ES6 arrow function.

No need for `.bind(this)` with ECMAScript6 syntax!

Signed-off-by: Kristján Oddsson <koddsson@gmail.com>
This commit is contained in:
Kristján Oddsson 2015-04-05 21:08:15 +00:00
parent 603b9c5952
commit 6e56c4f665
1 changed files with 4 additions and 4 deletions

View File

@ -31,11 +31,11 @@ var ImageCard = React.createClass({
handleTagOverlayClick: function (name) { handleTagOverlayClick: function (name) {
var $tagOverlay = $(this.getDOMNode()).find('.tag-overlay'); var $tagOverlay = $(this.getDOMNode()).find('.tag-overlay');
$tagOverlay.fadeIn(300); $tagOverlay.fadeIn(300);
$.get('https://registry.hub.docker.com/v1/repositories/' + name + '/tags', function (result) { $.get('https://registry.hub.docker.com/v1/repositories/' + name + '/tags', result => {
this.setState({ this.setState({
tags: result tags: result
}); });
}.bind(this)); });
}, },
handleCloseTagOverlay: function () { handleCloseTagOverlay: function () {
var $tagOverlay = $(this.getDOMNode()).find('.tag-overlay'); var $tagOverlay = $(this.getDOMNode()).find('.tag-overlay');
@ -51,12 +51,12 @@ var ImageCard = React.createClass({
util.exec(['open', $repoUri + this.props.image.name]); util.exec(['open', $repoUri + this.props.image.name]);
}, },
componentDidMount: function() { componentDidMount: function() {
$.get('https://registry.hub.docker.com/v1/repositories/' + this.props.image.name + '/tags', function (result) { $.get('https://registry.hub.docker.com/v1/repositories/' + this.props.image.name + '/tags', result => {
this.setState({ this.setState({
tags: result, tags: result,
chosenTag: result[0].name chosenTag: result[0].name
}); });
}.bind(this)); });
}, },
render: function () { render: function () {
var self = this; var self = this;