integration/js/home.js
changeset 6 547b3ddedf7f
child 8 7a5de13173b1
equal deleted inserted replaced
2:78f71aa0a477 6:547b3ddedf7f
       
     1 (function(){
       
     2 
       
     3     $(document).on('click', 'a.open-modal', function(e){
       
     4         e.preventDefault();
       
     5         var modalRemote = $(this).attr('href'),
       
     6             typeMedia = $(this).attr('data-type-media'),
       
     7             modalTitleInfo = $(this).attr('data-title'),
       
     8             titleFront;
       
     9 
       
    10         switch(typeMedia){
       
    11             case 'video' : titleFront = '<i class="icon-film"></i> Vidéo - '+modalTitleInfo; break;
       
    12             case 'image' : titleFront = '<i class="icon-picture"></i> Image - '+modalTitleInfo; break;
       
    13         }
       
    14         $('#modal-template .modal-header h3').html(titleFront);
       
    15 
       
    16         $("#modal-template .modal-body").load(modalRemote, function() { 
       
    17             $("#modal-template").modal("show"); 
       
    18         });
       
    19 
       
    20     });
       
    21 
       
    22 })(jQuery);