From 791a28ff16e25ecec2adcd6865ccf256426e6553 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Wed, 10 Oct 2018 14:44:43 +0100 Subject: [PATCH] js/modal.js --- lib/js/modal.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/js/modal.js b/lib/js/modal.js index 557306c8..bd43b368 100644 --- a/lib/js/modal.js +++ b/lib/js/modal.js @@ -27,15 +27,26 @@ $('
', { $(this).find('.modal-title').text(title); //console.log(title); - var body = ''; - if (orig.data('body')) $(this).find('.modal-body').html(orig.data('body')); - if (orig.data('footer')) $(this).find('.modal-footer').html(orig.data('footer')); + //var body = ''; + if (orig.data('body')) $(this).find('.modal-body').html(orig.data('body').clone(true)); + if (orig.data('footer')) $(this).find('.modal-footer').html(orig.data('footer').clone(true)); - $(this).find('iframe').focus(); + //$(this).find('iframe').focus(); + //console.log(orig.data('body').src); + if (0) $(this).find('[src]').each(function(){ + console.log(this.src); + console.log(orig.data('body')); + console.log(orig[0].outerHTML); + //$(this).attr('src',this.src); + }); }) .on('hide.bs.modal', function (e) { $(this).find('.modal-title').html(''); - $(this).find('[src]').attr('src',''); + $(this).find('[src]').attr('src','about:blank'); + $(this).find('.modal-body').html(''); + $(this).find('.modal-footer').html(''); + //$(this).find('[src]').attr('src','javascript:void(0);'); + //$(this).find('[src]').contents().find("body").html(''); }) .appendTo('body') ; -- 2.47.3