integration/js/common.js
changeset 66 dd2fbf4c998f
parent 55 cedadc7d039a
child 70 2542e988f80c
equal deleted inserted replaced
64:0e030a8977ed 66:dd2fbf4c998f
     9         e.preventDefault();
     9         e.preventDefault();
    10         var modalRemote = $(this).attr('href'),
    10         var modalRemote = $(this).attr('href'),
    11             typeMedia = $(this).attr('data-type-media'),
    11             typeMedia = $(this).attr('data-type-media'),
    12             modalTitleInfo = $(this).attr('data-title'),
    12             modalTitleInfo = $(this).attr('data-title'),
    13             hideBibliotheque = $(this).hasAttr('data-hide-bibliotheque') ? true : false,
    13             hideBibliotheque = $(this).hasAttr('data-hide-bibliotheque') ? true : false,
       
    14             hideAddNew = $(this).hasAttr('data-hide-add-new') ? true : false,
    14             titleFront;
    15             titleFront;
    15 
    16 
    16         switch(typeMedia){
    17         switch(typeMedia){
    17             case 'video' : titleFront = '<i class="icon-film"></i> Vidéo - '+modalTitleInfo; break;
    18             case 'video' : titleFront = '<i class="icon-film"></i> Vidéo - '+modalTitleInfo; break;
    18             case 'image' : titleFront = '<i class="icon-picture"></i> Image - '+modalTitleInfo; break;
    19             case 'image' : titleFront = '<i class="icon-picture"></i> Image - '+modalTitleInfo; break;
    21 
    22 
    22         $("#modal-template .modal-body").load(modalRemote, function() { 
    23         $("#modal-template .modal-body").load(modalRemote, function() { 
    23             $("#modal-template").modal("show"); 
    24             $("#modal-template").modal("show"); 
    24             if(hideBibliotheque)
    25             if(hideBibliotheque)
    25                 $("#modal-template").find(".bibliotheque-link").hide();
    26                 $("#modal-template").find(".bibliotheque-link").hide();
       
    27             if(hideAddNew)
       
    28                 $("#modal-template").find(".add-new").hide();
    26         });
    29         });
    27 
    30 
    28     });
    31     });
    29 
    32 
    30     $('.popup').on('click', '.popup-content a', function(e){
    33     $('.popup').on('click', '.popup-content a', function(e){