From 12ee321c64a964a56ad26a8d342f52c76250a0a3 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Thu, 4 Jul 2013 23:55:43 +0200 Subject: Task state and priority editing --- static/js/main.js | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) (limited to 'static/js/main.js') 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 ( - - + + - + {state} -- cgit v1.2.3-54-g00ecf