- Add Error Msg

This commit is contained in:
Vincent BRIDIER 2021-01-15 15:40:03 +01:00
parent 010d7b2e34
commit 7c22db073a
2 changed files with 11 additions and 2 deletions

2
public/js/app.js vendored

File diff suppressed because one or more lines are too long

View file

@ -12,6 +12,7 @@
</div>
<div class="card-body FoldersPage">
<div v-show="alertVisible" class="alert alert-success" role="alert">{{alertMsg}}</div>
<div v-show="alertErrorVisible" class="alert alert-danger" role="alert">{{alertMsg}}</div>
<VueNestable v-model="nestableItems" @change="changeOrder" :hooks="{'beforeMove': beforeMove}">
<VueNestableHandle slot-scope="{ item }" :item="item">
<span>
@ -133,6 +134,7 @@
folderId: "",
alertMsg: '',
alertVisible: false,
alertErrorVisible: false,
staticFolders: []
}
},
@ -200,7 +202,7 @@
},
addFolder() {
if (this.newFolderFR.length < 1){
this.showAlert("Nom du dossier vide.");
this.showAlertError("Nom du dossier vide.");
return;
}
this.done = false;
@ -317,6 +319,13 @@
setTimeout(() => {
this.alertVisible = false;
}, 1800);
},
showAlertError(msg) {
this.alertMsg = msg;
this.alertErrorVisible = true;
setTimeout(() => {
this.alertErrorVisible = false;
}, 1800);
}
}
}