diff options
author | Tom Willemse | 2013-07-04 23:55:43 +0200 |
---|---|---|
committer | Tom Willemse | 2013-07-04 23:55:43 +0200 |
commit | 12ee321c64a964a56ad26a8d342f52c76250a0a3 (patch) | |
tree | f74b9044aecbc500010742dc41b4a6aaac4be214 /static/js | |
parent | 6edd373ad92f6c966120c63ffe5b53fefe81d81e (diff) | |
download | scrumli-12ee321c64a964a56ad26a8d342f52c76250a0a3.tar.gz scrumli-12ee321c64a964a56ad26a8d342f52c76250a0a3.zip |
Task state and priority editing
Diffstat (limited to 'static/js')
-rw-r--r-- | static/js/main.js | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/static/js/main.js b/static/js/main.js index fbeb1bc..5eb9a2a 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -9,17 +9,44 @@ var StateIcon = React.createClass({ }); var StoryTaskRow = React.createClass({ + changeState: React.autoBind(function(event) { + $.ajax({ + url: "/tasks/state", + type: "POST", + data: {'id': this.props.task.id}, + dataType: 'json', + mimeType: 'textPlain' + }); + }), + moveUp: React.autoBind(function(event) { + $.ajax({ + url: "tasks/up", + type: "POST", + data: {'id': this.props.task.id}, + dataType: 'json', + mimeType: 'textPlain' + }); + }), + moveDown: React.autoBind(function(event) { + $.ajax({ + url: "tasks/down", + type: "POST", + data: {'id': this.props.task.id}, + dataType: 'json', + mimeType: 'textPlain' + }); + }), render: function() { var state = " " + this.props.task.state; return ( <tr> <td class="span1"> - <i class="icon-arrow-up"></i> - <i class="icon-arrow-down"></i> + <i class="icon-arrow-up" onClick={this.moveUp}></i> + <i class="icon-arrow-down" onClick={this.moveDown}></i> </td> <td class="span2"> - <span> + <span onClick={this.changeState}> <StateIcon state={this.props.task.state} /> {state} </span> |