diff --git a/public/index.html b/public/index.html index 668308a..c1f24f8 100644 --- a/public/index.html +++ b/public/index.html @@ -20,7 +20,7 @@ - + diff --git a/public/script.js b/public/script.jsx similarity index 94% rename from public/script.js rename to public/script.jsx index d5132da..1f1a869 100644 --- a/public/script.js +++ b/public/script.jsx @@ -60,25 +60,29 @@ var PlaylistBox = React.createClass({ currentId: null }; }, - clickOnItem: function (id, uid) { + clickOnItem: function (id, uid, event) { + event.preventDefault(); this.setState({currentId: id}); this.props.handleClick(id, uid); }, render: function () { - var ListGroup = ReactBootstrap.ListGroup; + var ListGroup = ReactBootstrap.ListGroup, + ListGroupItem = ReactBootstrap.ListGroupItem; var currentId = this.state.currentId; + var playlists =

No playlist found.

; if (this.props.playlists) { playlists = this.props.playlists.map(function (pl) { var id = pl.id; - var classes = "list-group-item" + (currentId == id ? " active" : ""); + var classes = currentId == id ? "active" : ""; return ( - {pl.name} + {pl.name} ); }, this); } + return ( - + {playlists} ); @@ -150,7 +154,7 @@ var DuplicateFinderBox = React.createClass({ } return ( - +

Playlists

{playlistBox}