mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
PHRAS-3442_optimize-list-notifications_4.1-bis
WIP poll only from menubar (Aina) back : only one method/route to fetch notifs front : fix exponential pagination big refacto todo : mark read notifications (button ? click ?)
This commit is contained in:
@@ -21,35 +21,37 @@ define([
|
||||
eventManager: _.extend({}, Backbone.Events)
|
||||
};
|
||||
|
||||
window.pullNotifications = function (){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: AdminApp.$scope.data("notif-url"),
|
||||
dataType: 'json',
|
||||
data: {
|
||||
module : 3,
|
||||
usr : AdminApp.$scope.data("usr")
|
||||
},
|
||||
error: function(){
|
||||
window.setTimeout("pullNotifications();", 10000);
|
||||
},
|
||||
timeout: function(){
|
||||
window.setTimeout("pullNotifications();", 10000);
|
||||
},
|
||||
success: function(data){
|
||||
if (data) {
|
||||
if (data.status == 'disconnected' || data.status == 'session') {
|
||||
self.location.replace(self.location.href);
|
||||
}
|
||||
}
|
||||
var t = 120000;
|
||||
if (data.apps && parseInt(data.apps) > 1) {
|
||||
t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
|
||||
}
|
||||
window.setTimeout("pullNotifications();", t);
|
||||
}
|
||||
});
|
||||
};
|
||||
// pull notification is called from menu bar
|
||||
|
||||
// window.pullNotifications = function (){
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: AdminApp.$scope.data("notif-url"),
|
||||
// dataType: 'json',
|
||||
// data: {
|
||||
// module : 3,
|
||||
// usr : AdminApp.$scope.data("usr")
|
||||
// },
|
||||
// error: function(){
|
||||
// window.setTimeout("pullNotifications();", 10000);
|
||||
// },
|
||||
// timeout: function(){
|
||||
// window.setTimeout("pullNotifications();", 10000);
|
||||
// },
|
||||
// success: function(data){
|
||||
// if (data) {
|
||||
// if (data.status == 'disconnected' || data.status == 'session') {
|
||||
// self.location.replace(self.location.href);
|
||||
// }
|
||||
// }
|
||||
// var t = 120000;
|
||||
// if (data.apps && parseInt(data.apps) > 1) {
|
||||
// t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000));
|
||||
// }
|
||||
// window.setTimeout("pullNotifications();", t);
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
window.enableForms = function (forms) {
|
||||
forms.bind('submit', function(event){
|
||||
var method = $(this).attr('method');
|
||||
|
@@ -15,7 +15,7 @@ define([
|
||||
var TaskCollection = Backbone.Collection.extend({
|
||||
model: TaskModel,
|
||||
url: function () {
|
||||
return "/admin/task-manager/tasks";
|
||||
return "/admin/task-manager/tasks?update_session=0";
|
||||
}
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user