|
@@ -335,11 +335,14 @@ $(document).ready(function(){
|
335
|
335
|
}
|
336
|
336
|
});
|
337
|
337
|
|
|
338
|
+ elements_edited = new Array();
|
338
|
339
|
// Ouverture du formulaire de modification
|
339
|
340
|
$('a.element_edit_link').live('click', function(){
|
340
|
341
|
|
341
|
342
|
link = $(this);
|
342
|
343
|
li = link.parent('li.element');
|
|
344
|
+ // On garde en mémoire l'élément édité en cas d'annulation
|
|
345
|
+ elements_edited[li.attr('id')] = li.html();
|
343
|
346
|
div_loader = li.find('div.loader');
|
344
|
347
|
li.html(div_loader);
|
345
|
348
|
li.find('img.element_loader').show();
|
|
@@ -367,6 +370,7 @@ $(document).ready(function(){
|
367
|
370
|
if (response.status == 'success')
|
368
|
371
|
{
|
369
|
372
|
li.html(response.html);
|
|
373
|
+ delete(elements_edited[li.attr('id')]);
|
370
|
374
|
}
|
371
|
375
|
else if (response.status == 'error')
|
372
|
376
|
{
|
|
@@ -386,6 +390,13 @@ $(document).ready(function(){
|
386
|
390
|
});
|
387
|
391
|
return false;
|
388
|
392
|
});
|
|
393
|
+
|
|
394
|
+ // Annulation d'un formulaire de modification d'élément
|
|
395
|
+ $('form.edit_element input.cancel_edit').live('click', function(){
|
|
396
|
+ var li = $(this).parent('form').parent('li');
|
|
397
|
+ li.html(elements_edited[li.attr('id')]);
|
|
398
|
+ delete(elements_edited[li.attr('id')]);
|
|
399
|
+ });
|
389
|
400
|
|
390
|
401
|
////////////////// TAG PROMPT ///////////////
|
391
|
402
|
|