aboutsummaryrefslogtreecommitdiffstats
path: root/js
diff options
context:
space:
mode:
authorGravatar Tom Willemse2013-05-22 21:50:56 +0200
committerGravatar Tom Willemse2013-05-22 21:50:56 +0200
commit2a9822daac3a77551f0bef4f714294eb0d3d5798 (patch)
tree09b23346862f1e30403e0baa21163d55fbdcbad0 /js
parent77eebc036114247a0ea34bf0a2d8369b3c7f041c (diff)
downloadscrumelo-2a9822daac3a77551f0bef4f714294eb0d3d5798.tar.gz
scrumelo-2a9822daac3a77551f0bef4f714294eb0d3d5798.zip
Get data on a story from the server
Uses a GET request to get extra data about a story, if that story already exists it removes it so users can hide/show as much as they like.
Diffstat (limited to 'js')
-rw-r--r--js/scrumelo.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/scrumelo.js b/js/scrumelo.js
index 055652a..e408aa7 100644
--- a/js/scrumelo.js
+++ b/js/scrumelo.js
@@ -6,3 +6,19 @@
});
});
})(jQuery);
+
+function get_story_info(element) {
+ var id = element.id;
+ var data_element = $(element).parent().find(".data");
+
+ if (data_element.length > 0)
+ data_element.remove();
+ else
+ $.get('/stories/' + id, null,
+ function (data, textStatus, jqXHR) {
+ $(element).after("<div class=\"data\">" +
+ "Assignee: " + data.Assignee +
+ "<pre>" + data.content + "</pre>" +
+ "</div>");
+ }, 'json');
+}