integration/js/projet.js
changeset 9 e3d551eda5a6
parent 6 547b3ddedf7f
child 16 c66274d0d850
equal deleted inserted replaced
8:7a5de13173b1 9:e3d551eda5a6
     1 (function(){
     1 $(function(){
     2 
     2 
     3     $('body').on('click focus', 'input[readonly]', function(e){
     3     $('body').on('click focus', 'input[readonly]', function(e){
     4         $(this).select();
     4         $(this).select();
     5     });
     5     });
     6 
     6 
    10     });
    10     });
    11     clip.on( 'complete', function(client, args) {
    11     clip.on( 'complete', function(client, args) {
    12       alert("Copied text to clipboard: " + args.text );
    12       alert("Copied text to clipboard: " + args.text );
    13     });
    13     });
    14 
    14 
    15 //confirmation suppression
    15 });
    16     $(document).on('click','.btn-delete', function(e){
       
    17         e.preventDefault();
       
    18         var titleMedia = $(this).attr('data-title'),
       
    19             textModal = $('<p>Êtes-vous sûr de vouloir supprimer <strong>'+titleMedia+'</strong> ?</p>'),
       
    20             eltDelete = $(this).attr('href');
       
    21 
       
    22         $("#modal-confirm #btn-delete-modal").attr('data-id-elt-delete', eltDelete);
       
    23         $("#modal-confirm .modal-body").empty().append(textModal); 
       
    24         $("#modal-confirm").modal('show');
       
    25     });
       
    26 
       
    27     $("#modal-confirm").on('click', '#btn-delete-modal', function(e){
       
    28         e.preventDefault();
       
    29         var idEltDelete = $(this).attr('data-id-elt-delete');
       
    30         $(idEltDelete).remove();
       
    31         $("#modal-confirm").modal('hide');
       
    32     });
       
    33 
       
    34 })(jQuery);