Short opacity transition when adding notifications. #932
This commit is contained in:
parent
7a6dcb5f73
commit
818d78380e
@ -1127,6 +1127,7 @@
|
|||||||
this.el = $.el('div', {
|
this.el = $.el('div', {
|
||||||
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
|
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
|
||||||
});
|
});
|
||||||
|
this.el.style.opacity = 0;
|
||||||
this.setType(type);
|
this.setType(type);
|
||||||
$.on(this.el.firstElementChild, 'click', this.close);
|
$.on(this.el.firstElementChild, 'click', this.close);
|
||||||
if (typeof content === 'string') {
|
if (typeof content === 'string') {
|
||||||
@ -1147,6 +1148,8 @@
|
|||||||
}
|
}
|
||||||
$.off(d, 'visibilitychange', this.add);
|
$.off(d, 'visibilitychange', this.add);
|
||||||
$.add($.id('notifications'), this.el);
|
$.add($.id('notifications'), this.el);
|
||||||
|
this.el.clientHeight;
|
||||||
|
this.el.style.opacity = 1;
|
||||||
if (this.timeout) {
|
if (this.timeout) {
|
||||||
return setTimeout(this.close, this.timeout * $.SECOND);
|
return setTimeout(this.close, this.timeout * $.SECOND);
|
||||||
}
|
}
|
||||||
@ -6964,7 +6967,7 @@
|
|||||||
if (err) {
|
if (err) {
|
||||||
if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
|
if (/captcha|verification/i.test(err.textContent) || err === 'Connection error with sys.4chan.org.') {
|
||||||
if (/mistyped/i.test(err.textContent)) {
|
if (/mistyped/i.test(err.textContent)) {
|
||||||
err = 'Error: You seem to have mistyped the CAPTCHA.';
|
err = 'You seem to have mistyped the CAPTCHA.';
|
||||||
}
|
}
|
||||||
QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false;
|
QR.cooldown.auto = QR.captcha.isEnabled ? !!QR.captcha.captchas.length : err === 'Connection error with sys.4chan.org.' ? true : false;
|
||||||
QR.cooldown.set({
|
QR.cooldown.set({
|
||||||
|
|||||||
@ -96,6 +96,7 @@ class Notification
|
|||||||
|
|
||||||
@el = $.el 'div',
|
@el = $.el 'div',
|
||||||
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
|
innerHTML: '<a href=javascript:; class=close title=Close>×</a><div class=message></div>'
|
||||||
|
@el.style.opacity = 0
|
||||||
@setType type
|
@setType type
|
||||||
$.on @el.firstElementChild, 'click', @close
|
$.on @el.firstElementChild, 'click', @close
|
||||||
if typeof content is 'string'
|
if typeof content is 'string'
|
||||||
@ -113,6 +114,8 @@ class Notification
|
|||||||
return
|
return
|
||||||
$.off d, 'visibilitychange', @add
|
$.off d, 'visibilitychange', @add
|
||||||
$.add $.id('notifications'), @el
|
$.add $.id('notifications'), @el
|
||||||
|
@el.clientHeight # force reflow
|
||||||
|
@el.style.opacity = 1
|
||||||
setTimeout @close, @timeout * $.SECOND if @timeout
|
setTimeout @close, @timeout * $.SECOND if @timeout
|
||||||
|
|
||||||
close = ->
|
close = ->
|
||||||
|
|||||||
@ -927,7 +927,7 @@ QR =
|
|||||||
if /captcha|verification/i.test(err.textContent) or err is 'Connection error with sys.4chan.org.'
|
if /captcha|verification/i.test(err.textContent) or err is 'Connection error with sys.4chan.org.'
|
||||||
# Remove the obnoxious 4chan Pass ad.
|
# Remove the obnoxious 4chan Pass ad.
|
||||||
if /mistyped/i.test err.textContent
|
if /mistyped/i.test err.textContent
|
||||||
err = 'Error: You seem to have mistyped the CAPTCHA.'
|
err = 'You seem to have mistyped the CAPTCHA.'
|
||||||
# Enable auto-post if we have some cached captchas.
|
# Enable auto-post if we have some cached captchas.
|
||||||
QR.cooldown.auto = if QR.captcha.isEnabled
|
QR.cooldown.auto = if QR.captcha.isEnabled
|
||||||
!!QR.captcha.captchas.length
|
!!QR.captcha.captchas.length
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user