]> git.nbdom.net Git - nb.git/commitdiff
js/modal.js
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 10 Oct 2018 13:44:43 +0000 (14:44 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Wed, 10 Oct 2018 13:44:43 +0000 (14:44 +0100)
lib/js/modal.js

index 557306c86387586e56256068018cdb485c2106f7..bd43b368e1b31668b1d4bff66c734a8df4a75dec 100644 (file)
@@ -27,15 +27,26 @@ $('<div/>', {
        $(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')
 ;