Show book details in modal dialog

With them shown in a modal, you don't lose your place in the pagination. If the request comes via Ajax, the minimal layout is used. If via a normal request, the full layout is used. That lets you open the details in a new tab and have the full experience, but if you're clicking through the results of a search, you can view many without losing your place.
This commit is contained in:
Jonathan Rehm
2017-07-08 09:15:40 -07:00
parent 93dfb96174
commit 675e8dd5cd
9 changed files with 41 additions and 7 deletions
+11
View File
@@ -121,6 +121,17 @@ $(function() {
});
});
$('#bookDetailsModal')
.on('show.bs.modal', function(e) {
var $modalBody = $(this).find('.modal-body');
$.get(e.relatedTarget.href).done(function(content) {
$modalBody.html(content);
});
})
.on('hidden.bs.modal', function() {
$(this).find('.modal-body').html('...');
});
$(window).resize(function(event) {
$(".discover .row").isotope("reLayout");
});