# HG changeset patch # User cavaliet # Date 1370426180 -7200 # Node ID 5dddae65a99ad34abe4360e9d9a76658d2b9cf3e # Parent 0e4fa3991906f7ab104009a3cc673fe695586ee8 iframe modal used for content preview diff -r 0e4fa3991906 -r 5dddae65a99a integration/js/common.js --- a/integration/js/common.js Tue Jun 04 17:17:17 2013 +0200 +++ b/integration/js/common.js Wed Jun 05 11:56:20 2013 +0200 @@ -12,6 +12,7 @@ modalTitleInfo = $(this).attr('data-title'), hideBibliotheque = $(this).hasAttr('data-hide-bibliotheque') ? true : false, hideAddNew = $(this).hasAttr('data-hide-add-new') ? true : false, + isIframe = $(this).hasAttr('data-iframe') ? true : false, titleFront; switch(typeMedia){ @@ -19,15 +20,25 @@ case 'image' : titleFront = ' Image - '+modalTitleInfo; break; } $('#modal-template .modal-header h3').html(titleFront); - - $("#modal-template .modal-body").load(modalRemote, function() { - $("#modal-template").modal("show"); + + if(isIframe){ if(hideBibliotheque) $("#modal-template").find(".bibliotheque-link").hide(); if(hideAddNew) $("#modal-template").find(".add-new").hide(); - }); + $("#modal-template .modal-body").html(''); + $("#modal-template").modal("show"); + } + else{ + $("#modal-template .modal-body").load(modalRemote, function() { + $("#modal-template").modal("show"); + if(hideBibliotheque) + $("#modal-template").find(".bibliotheque-link").hide(); + if(hideAddNew) + $("#modal-template").find(".add-new").hide(); + }); + } }); $('.popup').on('click', '.popup-content a', function(e){ @@ -43,6 +54,11 @@ }); +// empty modal when closed + $("#modal-template .modal-header .close").click(function(e){ + $("#modal-template .modal-body").html(''); + }); + //confirmation suppression $(document).on('click','.btn-delete', function(e){ e.preventDefault(); diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/static/metadatacomposer/js/common.js --- a/src/metadatacomposer/static/metadatacomposer/js/common.js Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/static/metadatacomposer/js/common.js Wed Jun 05 11:56:20 2013 +0200 @@ -12,6 +12,7 @@ modalTitleInfo = $(this).attr('data-title'), hideBibliotheque = $(this).hasAttr('data-hide-bibliotheque') ? true : false, hideAddNew = $(this).hasAttr('data-hide-add-new') ? true : false, + isIframe = $(this).hasAttr('data-iframe') ? true : false, titleFront; switch(typeMedia){ @@ -19,15 +20,25 @@ case 'image' : titleFront = ' Image - '+modalTitleInfo; break; } $('#modal-template .modal-header h3').html(titleFront); - - $("#modal-template .modal-body").load(modalRemote, function() { - $("#modal-template").modal("show"); + + if(isIframe){ if(hideBibliotheque) $("#modal-template").find(".bibliotheque-link").hide(); if(hideAddNew) $("#modal-template").find(".add-new").hide(); - }); + $("#modal-template .modal-body").html(''); + $("#modal-template").modal("show"); + } + else{ + $("#modal-template .modal-body").load(modalRemote, function() { + $("#modal-template").modal("show"); + if(hideBibliotheque) + $("#modal-template").find(".bibliotheque-link").hide(); + if(hideAddNew) + $("#modal-template").find(".add-new").hide(); + }); + } }); $('.popup').on('click', '.popup-content a', function(e){ @@ -43,6 +54,11 @@ }); +// empty modal when closed + $("#modal-template .modal-header .close").click(function(e){ + $("#modal-template .modal-body").html(''); + }); + //confirmation suppression $(document).on('click','.btn-delete', function(e){ e.preventDefault(); diff -r 0e4fa3991906 -r 5dddae65a99a src/metadatacomposer/templates/metadatacomposer_home.html --- a/src/metadatacomposer/templates/metadatacomposer_home.html Tue Jun 04 17:17:17 2013 +0200 +++ b/src/metadatacomposer/templates/metadatacomposer_home.html Wed Jun 05 11:56:20 2013 +0200 @@ -98,7 +98,7 @@
{% endthumbnail %}
{% endthumbnail %}