Fix non-existent protocol-card in preview banner

This commit is contained in:
Jure Grabnar 2019-06-28 08:49:12 +02:00
parent 149f45f4fc
commit 1a9fca87d2

View file

@ -165,6 +165,11 @@ function handleFormSubmit(modal) {
function initLoadProtocolModalPreview() {
$('.external-import-btn').off('click').on('click', function(e) {
var link = $(this).parents('.protocol-card');
// When clicking on the banner button, we have no protocol-card parent
if (link.length == 0)
link = $('.protocol-card.active');
animateSpinner(null, true);
$.ajax({
url: link.data('url'),