tweaked bookmark generateID function, so it's collision free
This commit is contained in:
parent
98d50fe66d
commit
3527cf1acb
@ -49,6 +49,8 @@
|
||||
window.plugin.bookmarks.updateQueue = {};
|
||||
window.plugin.bookmarks.updatingQueue = {};
|
||||
|
||||
window.plugin.bookmarks.IDcount = 0;
|
||||
|
||||
window.plugin.bookmarks.enableSync = false;
|
||||
|
||||
window.plugin.bookmarks.starLayers = {};
|
||||
@ -67,7 +69,8 @@
|
||||
// Generate an ID for the bookmark (date time + random number)
|
||||
window.plugin.bookmarks.generateID = function() {
|
||||
var d = new Date();
|
||||
var ID = d.getTime()+(Math.floor(Math.random()*99)+1);
|
||||
var ID = d.getTime().toString() + window.plugin.bookmarks.IDcount.toString() + (Math.floor(Math.random()*99)+1);
|
||||
window.plugin.bookmarks.IDcount++;
|
||||
var ID = 'id'+ID.toString();
|
||||
return ID;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user