|
@@ -31,7 +31,7 @@
|
|
|
</a>
|
|
|
<ul>
|
|
|
<li><button class="btn-floating blue lighten-3 tooltipped" data-position="bottom" data-tooltip="Fermer" onclick="back()"><i class="material-icons">close</i></button></li>
|
|
|
- <li><button class="btn-floating blue lighten-2 tooltipped" data-position="bottom" data-tooltip="Supprimer" onclick="removeCard()"><i class="material-icons">delete</i></button></li>
|
|
|
+ <li><button id="remove-btn" class="btn-floating blue lighten-2 tooltipped" data-position="bottom" data-tooltip="Supprimer" onclick="removeCard()"><i class="material-icons">delete</i></button></li>
|
|
|
<li><button class="btn-floating blue lighten-1 tooltipped" data-position="bottom" data-tooltip="Sauvegarder" onclick="validCard()"><i class="material-icons">save</i></button></li>
|
|
|
</ul>
|
|
|
</div>
|
|
@@ -95,6 +95,8 @@
|
|
|
document.title = 'Electronotes - Modification';
|
|
|
} else {
|
|
|
document.title = 'Electronotes - Création';
|
|
|
+ //Disabled remove button
|
|
|
+ $('#remove-btn').attr('disabled', true);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -162,9 +164,13 @@
|
|
|
}
|
|
|
|
|
|
function removeCard() {
|
|
|
- // Remove card
|
|
|
- // Go back to main page
|
|
|
- back();
|
|
|
+ // If update card
|
|
|
+ if (GET.id) {
|
|
|
+ // Remove card
|
|
|
+ deleteData(GET.id);
|
|
|
+ // Go back to main page
|
|
|
+ back();
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|