scrumelo/js/scrumelo.js
Tom Willemse 2a9822daac 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.
2013-05-22 21:50:56 +02:00

24 lines
776 B
JavaScript

(function ($) {
$(document).ready(function () {
$(".hide").hide();
$(".toggle").click(function () {
$(document.getElementById($(this).data("show"))).toggle();
});
});
})(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');
}