From 3cfa1d1cae9cc5dc1b4ca3210ae39a16e3c45ccf Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 5 Mar 2017 23:05:42 +0300 Subject: add dropdown menu item to show book summary --- js/index.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'js/index.js') diff --git a/js/index.js b/js/index.js index 349794a..ac418da 100644 --- a/js/index.js +++ b/js/index.js @@ -150,6 +150,21 @@ function init_tooltips() { } } }); +} + +function show_summary(elem) { + var id = elem.getAttribute("data-book-id"); + + $.post("backend.php", {op: 'getinfo', id: id}, function(data) { + + var comment = data.comment ? data.comment : 'No description available'; + + $("#summary-modal .modal-title").html(data.title); + $("#summary-modal .book-summary").html(comment); + + $("#summary-modal").modal(); + + }); } -- cgit v1.2.3