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