| author | Anthony Ly <anthonyly.com@gmail.com> |
| Thu, 16 May 2013 13:08:20 +0200 | |
| changeset 8 | 7a5de13173b1 |
| parent 6 | 547b3ddedf7f |
| child 9 | e3d551eda5a6 |
| permissions | -rw-r--r-- |
| 6 | 1 |
(function(){ |
2 |
||
3 |
$('.tab-behavior a').click(function (e) { |
|
4 |
e.preventDefault(); |
|
5 |
$(this).tab('show'); |
|
6 |
}); |
|
7 |
|
|
8 |
$(document).on('click', 'a.open-modal', function(e){ |
|
9 |
e.preventDefault(); |
|
10 |
var modalRemote = $(this).attr('href'), |
|
11 |
typeMedia = $(this).attr('data-type-media'), |
|
12 |
modalTitleInfo = $(this).attr('data-title'), |
|
13 |
titleFront; |
|
14 |
||
15 |
switch(typeMedia){ |
|
16 |
case 'video' : titleFront = '<i class="icon-film"></i> Vidéo - '+modalTitleInfo; break; |
|
17 |
case 'image' : titleFront = '<i class="icon-picture"></i> Image - '+modalTitleInfo; break; |
|
18 |
} |
|
19 |
$('#modal-template .modal-header h3').html(titleFront); |
|
20 |
||
21 |
$("#modal-template .modal-body").load(modalRemote, function() { |
|
22 |
$("#modal-template").modal("show"); |
|
|
8
7a5de13173b1
hide bibliotheque link on home and resource page
Anthony Ly <anthonyly.com@gmail.com>
parents:
6
diff
changeset
|
23 |
$("#modal-template").find(".bibliotheque-link").hide(); |
| 6 | 24 |
}); |
25 |
||
26 |
}); |
|
27 |
||
28 |
//confirmation suppression |
|
29 |
$(document).on('click','.btn-delete', function(e){ |
|
30 |
e.preventDefault(); |
|
31 |
var titleMedia = $(this).attr('data-title'), |
|
32 |
textModal = $('<p>Êtes-vous sûr de vouloir supprimer <strong>'+titleMedia+'</strong> ?</p>'), |
|
33 |
eltDelete = $(this).attr('href'); |
|
34 |
$("#modal-confirm #btn-delete-modal").attr('data-id-elt-delete', eltDelete); |
|
35 |
$("#modal-confirm .modal-body").empty().append(textModal); |
|
36 |
$("#modal-confirm").modal('show'); |
|
37 |
}); |
|
38 |
||
39 |
$("#modal-confirm").on('click', '#btn-delete-modal', function(e){ |
|
40 |
e.preventDefault(); |
|
41 |
var idEltDelete = $(this).attr('data-id-elt-delete'); |
|
42 |
$(idEltDelete).remove(); |
|
43 |
$("#modal-confirm").modal('hide'); |
|
44 |
}); |
|
45 |
||
46 |
})(jQuery); |