mirror of
https://github.com/getformwork/formwork.git
synced 2025-01-17 21:49:04 +01:00
Make notifications disappear by clicking on them (closes #3)
This commit is contained in:
parent
a3a8476f8d
commit
3b983e056a
@ -1769,9 +1769,13 @@ label {
|
||||
border-radius: 3px;
|
||||
background-color: #f0f0f0;
|
||||
box-shadow: rgba(0, 0, 0, 0.15) 1px 1px 9px 0;
|
||||
transition: top 300ms ease-in;
|
||||
cursor: default;
|
||||
transition: top 300ms ease-in, opacity 150ms;
|
||||
animation: fadeInRight 300ms cubic-bezier(0.4, 0, 0.2, 1); }
|
||||
|
||||
.notification:hover {
|
||||
opacity: 0.95; }
|
||||
|
||||
.notification.fadeout {
|
||||
opacity: 0;
|
||||
animation: fadeOutRight 300ms cubic-bezier(0.4, 0, 0.2, 1); }
|
||||
|
2
admin/assets/css/admin.min.css
vendored
2
admin/assets/css/admin.min.css
vendored
File diff suppressed because one or more lines are too long
@ -441,14 +441,28 @@ Formwork.Notification = function(text, type, interval) {
|
||||
|
||||
$notification.appendTo('body');
|
||||
|
||||
setTimeout(function() {
|
||||
var timer = setTimeout(remove, interval);
|
||||
|
||||
$notification.click(remove);
|
||||
|
||||
$notification.mouseenter(function() {
|
||||
clearTimeout(timer);
|
||||
});
|
||||
|
||||
$notification.mouseleave(function() {
|
||||
timer = setTimeout(remove, 1000);
|
||||
});
|
||||
|
||||
function remove() {
|
||||
var found = false;
|
||||
var offset = $notification.outerHeight(true);
|
||||
|
||||
$('.notification').each(function() {
|
||||
var $this = $(this);
|
||||
if ($this.is($notification)) {
|
||||
found = true;
|
||||
$this.addClass('fadeout');
|
||||
} else {
|
||||
} else if (found) {
|
||||
$this.css('top', '-=' + offset);
|
||||
}
|
||||
});
|
||||
@ -457,7 +471,8 @@ Formwork.Notification = function(text, type, interval) {
|
||||
$notification.remove();
|
||||
}, 400);
|
||||
|
||||
}, interval);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Formwork.Pages = {
|
||||
|
2
admin/assets/js/app.min.js
vendored
2
admin/assets/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
@ -15,14 +15,28 @@ Formwork.Notification = function(text, type, interval) {
|
||||
|
||||
$notification.appendTo('body');
|
||||
|
||||
setTimeout(function() {
|
||||
var timer = setTimeout(remove, interval);
|
||||
|
||||
$notification.click(remove);
|
||||
|
||||
$notification.mouseenter(function() {
|
||||
clearTimeout(timer);
|
||||
});
|
||||
|
||||
$notification.mouseleave(function() {
|
||||
timer = setTimeout(remove, 1000);
|
||||
});
|
||||
|
||||
function remove() {
|
||||
var found = false;
|
||||
var offset = $notification.outerHeight(true);
|
||||
|
||||
$('.notification').each(function() {
|
||||
var $this = $(this);
|
||||
if ($this.is($notification)) {
|
||||
found = true;
|
||||
$this.addClass('fadeout');
|
||||
} else {
|
||||
} else if (found) {
|
||||
$this.css('top', '-=' + offset);
|
||||
}
|
||||
});
|
||||
@ -31,5 +45,6 @@ Formwork.Notification = function(text, type, interval) {
|
||||
$notification.remove();
|
||||
}, 400);
|
||||
|
||||
}, interval);
|
||||
}
|
||||
|
||||
};
|
||||
|
@ -9,10 +9,15 @@
|
||||
border-radius: 3px;
|
||||
background-color: $color-gray-xlight;
|
||||
box-shadow: rgba(0, 0, 0, 0.15) 1px 1px 9px 0;
|
||||
transition: top 300ms ease-in;
|
||||
cursor: default;
|
||||
transition: top 300ms ease-in, opacity 150ms;
|
||||
animation: fadeInRight 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
||||
}
|
||||
|
||||
.notification:hover {
|
||||
opacity: 0.95;
|
||||
}
|
||||
|
||||
.notification.fadeout {
|
||||
opacity: 0;
|
||||
animation: fadeOutRight 300ms cubic-bezier(0.4, 0.0, 0.2, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user