Tom Willemse
2a9822daac
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.
24 lines
776 B
JavaScript
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');
|
|
}
|