fix: error togging unexpectedly
parent
eddd813846
commit
acec4a6af9
|
@ -1,6 +1,6 @@
|
|||
{{define "components/error"}}
|
||||
<div class="notification is-danger {{if not .Error}}is-hidden{{end}}" id="error_view">
|
||||
<button class="delete" onclick="ErrorTog()"></button>
|
||||
<button class="delete" onclick="ErrorClose()"></button>
|
||||
<p id="err_msg">{{.Error}}</p>
|
||||
</div>
|
||||
<script>
|
||||
|
@ -8,10 +8,18 @@ function ErrorTog(){
|
|||
let el = document.getElementById('error_view');
|
||||
el.classList.toggle('is-hidden');
|
||||
}
|
||||
function ErrorOpen(){
|
||||
let el = document.getElementById('error_view');
|
||||
el.classList.remove('is-hidden');
|
||||
}
|
||||
function ErrorClose(){
|
||||
let el = document.getElementById('error_view');
|
||||
el.classList.add('is-hidden');
|
||||
}
|
||||
function ShowError(msg){
|
||||
let el = document.getElementById('err_msg');
|
||||
el.innerHTML = msg;
|
||||
ErrorTog();
|
||||
ErrorOpen();
|
||||
}
|
||||
</script>
|
||||
{{end}}
|
Loading…
Reference in New Issue