make confirm msg auto-fade

pull/2/head
Ondřej Hruška 7 years ago
parent 64c1ebbf8f
commit c846cffedb
Signed by: MightyPork
GPG Key ID: 2C5FD5035250423D
  1. 11
      js/appcommon.js
  2. 5
      sass/form/_form_layout.scss

@ -112,8 +112,15 @@ $.ready(function () {
let msgAt = window.location.search.indexOf('msg=') let msgAt = window.location.search.indexOf('msg=')
if (msgAt !== -1 && qs('.Box.message')) { if (msgAt !== -1 && qs('.Box.message')) {
let msg = decodeURIComponent(window.location.search.substr(msgAt + 4)) let msg = decodeURIComponent(window.location.search.substr(msgAt + 4))
qs('.Box.message').innerHTML = msg let box = qs('.Box.message')
qs('.Box.message').classList.remove('hidden') box.innerHTML = msg
box.classList.remove('hidden')
setTimeout(() => {
box.classList.add('hiding')
setTimeout(() => {
box.classList.add('hidden')
}, 1000)
}, 2000)
} }
modal.init() modal.init()

@ -15,6 +15,11 @@ form { @include naked(); }
.Box.message { .Box.message {
font-weight: bold; font-weight: bold;
color: #0fca50; color: #0fca50;
transition: opacity linear 1s;
opacity: 1;
&.hiding {
opacity: 0;
}
} }
.Row { .Row {

Loading…
Cancel
Save