Skip to content
Extraits de code Groupes Projets
Valider 7abfa987 rédigé par nicod's avatar nicod
Parcourir les fichiers

UI: les boutons "Annuler" rechargent le formulaire d'ajout en ajax

parent 7f68fa55
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -83,6 +83,8 @@ if (window.jQuery) { ...@@ -83,6 +83,8 @@ if (window.jQuery) {
} }
$(function() { $(function() {
// édition en place des blocs
$('.objet_blocks .actions .editer_block').on('click', function(e) { $('.objet_blocks .actions .editer_block').on('click', function(e) {
e.preventDefault(); e.preventDefault();
let $parent = $(this).parents('.objetblock').first(); let $parent = $(this).parents('.objetblock').first();
...@@ -99,4 +101,14 @@ $(function() { ...@@ -99,4 +101,14 @@ $(function() {
$content.html(data).addClass('objetblock__content--edit'); $content.html(data).addClass('objetblock__content--edit');
}); });
}); });
// boutons "Annuler"
function annuler_ajouter_block() {
$('.formulaire_editer_block button[name="annuler"]').on('click', function(e) {
e.preventDefault();
ajaxReload('ajouter_block');
});
}
annuler_ajouter_block();
onAjaxLoad(annuler_ajouter_block);
}); });
<div class="ajax ajout_block" id="ajout_block">
[(#FORMULAIRE_EDITER_BLOCK{#ENV{id_block,new}, #OBJET, #ID_OBJET, #SELF#ajout_block, 1})]
</div>
...@@ -50,9 +50,7 @@ ...@@ -50,9 +50,7 @@
</B> </B>
<div class="ajax ajout_block" id="ajout_block"> <INCLURE{fond=prive/squelettes/inclure/ajouter_block, env, ajax=ajouter_block}>
[(#FORMULAIRE_EDITER_BLOCK{#ENV{id_block,new}, #OBJET, #ID_OBJET, #SELF#ajout_block, 1})]
</div>
<script type="text/javascript"> <script type="text/javascript">
/* Gestion du tri des blocks */ /* Gestion du tri des blocks */
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter