diff --git a/index.html b/index.html index e548be7..1b94e31 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ + diff --git a/react/react.js b/react/react.js index 34c2bc7..0542be6 100644 --- a/react/react.js +++ b/react/react.js @@ -11,10 +11,13 @@ var IssueList = React.createClass({ body={issue.body} createdAt={issue.created_at} updatedAt={issue.updated_at} + closedAt={issue.closed_at} url={issue.html_url} labels={issue.labels} milestone={issue.milestone} number={issue.number} + comments={issue.comments} + pullRequest={issue.pull_request} state={issue.state} title={issue.title} />); }); @@ -28,10 +31,7 @@ var IssueList = React.createClass({ }); var IssueRow = React.createClass({ - render: function() { - var converter = new Showdown.converter(); - var dangerousHtml = converter.makeHtml(this.props.body.toString()); - + getInitialState: function() { var state = this.props.state; var classString = 'issue ' + state; var tagList = ''; @@ -44,14 +44,39 @@ var IssueRow = React.createClass({ title={tag.name} />); }); + return { + classString: classString, + state: state, + tagList: tagList, + tags: tags, + }; + }, + toggleExpanded: function(ev) { + var newClassString = this.state.classString; + var expandedClass = ' expanded'; + + if (this.state.classString.indexOf(expandedClass) > 0) { + newClassString = this.state.classString.replace(expandedClass, ''); + } else { + newClassString += expandedClass; + } + + this.setState({ + classString: newClassString, + }); + }, + render: function() { + var converter = new Showdown.converter(); + var dangerousHtml = converter.makeHtml(this.props.body.toString()); + return ( -
+

{this.props.authorUserLogin}

-
+
state:
-

{state}

+

{this.state.state}

@@ -69,7 +94,14 @@ var IssueRow = React.createClass({
tagged:
-

{tags}

+

{this.state.tags}

+
+
+
+
+
+ comments : {this.props.comments} +
@@ -189,6 +221,7 @@ var FilterableIssueList = React.createClass({ }, updateIssues: function() { var headers = null; + var self = this; if (this.state.authToken !== null && this.state.authToken.length > 0) { headers = { @@ -196,7 +229,7 @@ var FilterableIssueList = React.createClass({ }; } - $.ajax({ + reqwest({ url: 'https://api.github.com/repos/' + this.state.repo + '/issues', headers: headers, data: { @@ -204,13 +237,14 @@ var FilterableIssueList = React.createClass({ sort: this.state.sort, state: this.state.state, }, - success: function(result) { - if (this.isMounted()) { - this.setState({ - issues: result, - }); + method: 'get', + success: function (result) { + if (self.isMounted()) { + self.setState({ + issues: result, + }); + } } - }.bind(this), }); }, onUpdateDisplayClosed: function(val) { diff --git a/style.css b/style.css index d699503..0952056 100644 --- a/style.css +++ b/style.css @@ -140,7 +140,7 @@ h6 { .header-thing h1 { color: rgba(255, 255, 255, 0.83); float: right; - letter-spacing: 7px; + letter-spacing: 7px; text-align: center; } @@ -184,3 +184,13 @@ h6 { background-color: rgb(203, 216, 203); box-shadow: 0px 0px 3px rgba(0,0,0,0.3); } + +.expandableArea { + clear: both; + display: none; +} + +.expanded > .expandableArea { + display: inline !important; +} +