demarches-normaliennes/app/assets/javascripts/channels/notifications.js

24 lines
557 B
JavaScript
Raw Normal View History

2017-01-02 10:25:47 +01:00
//App.messages = App.cable.subscriptions.create('NotificationsChannel', {
2017-04-04 16:15:33 +02:00
// received: function (data) {
// if (window.location.href.indexOf('backoffice') !== -1) {
// $("#notification-alert").html(data['message']);
2017-01-02 10:25:47 +01:00
//
2017-04-04 16:15:33 +02:00
// slideIn_notification_alert();
2017-01-02 10:25:47 +01:00
// }
2017-04-04 16:15:33 +02:00
// }
2017-01-02 10:25:47 +01:00
//});
function slideIn_notification_alert (){
$("#notification-alert").animate({
2017-04-04 16:15:33 +02:00
right: '20px'
}, 250);
2017-04-04 16:15:33 +02:00
setTimeout(slideOut_notification_alert, 3500);
}
function slideOut_notification_alert (){
$("#notification-alert").animate({
2017-04-04 16:15:33 +02:00
right: '-250px'
}, 200);
2017-04-04 15:27:04 +02:00
}