#2097: Use localStorage.length instead to get number of entries

It looks like some older browsers are not compatible with the keys()
function of jquery.storageapi, but are compatible with just
localStorage.length.
This commit is contained in:
Toks
2014-02-15 21:01:51 -05:00
parent 840103efdb
commit 0519c44821

View File

@@ -20,7 +20,7 @@
}
Danbooru.Autocomplete.prune_local_storage = function() {
if (this.enable_local_storage && $.localStorage.keys().length > 10000) {
if (this.enable_local_storage && localStorage.length > 10000) {
$.localStorage.removeAll();
}
}