[enh] move to new js-cookie API

This commit is contained in:
Julien Malik 2016-03-05 12:10:41 +01:00
parent 98bbda57c0
commit 1ed953f90c

View file

@ -27,8 +27,7 @@
}) })
.done(function(xml){ .done(function(xml){
// Get viewed security alerts from cookie // Get viewed security alerts from cookie
$.cookie.json = true; var viewedItems = Cookies.get('ynhSecurityViewedItems') || [];
var viewedItems = $.cookie('ynhSecurityViewedItems') || [];
// Loop through items // Loop through items
$('item', xml).each(function(k, v) { $('item', xml).each(function(k, v) {
@ -57,8 +56,8 @@
} }
}); });
// Saved viewed items to cookie // Saved viewed items to cookie
$.cookie('ynhSecurityViewedItems', viewedItems, { Cookies.set('ynhSecurityViewedItems', viewedItems, {
expire: 7 expires: 7
}); });
}) })
.fail(function() { .fail(function() {
@ -158,4 +157,4 @@
}, 'GET', {}, false); }, 'GET', {}, false);
}); });
})(); })();