bookmarks: additional protection against multiple bookmark stars being added to the portal details

This commit is contained in:
Jon Atkins 2015-07-26 08:11:48 +01:00
parent 5a5a5a21fb
commit 0d88cfd8ba

View File

@ -292,12 +292,20 @@
}
// Append a 'star' flag in sidebar.
window.plugin.bookmarks.onPortalSelectedPending = false;
window.plugin.bookmarks.onPortalSelected = function() {
$('.bkmrksStar').remove();
if(window.selectedPortal == null) return;
if (!window.plugin.bookmarks.onPortalSelectedPending) {
window.plugin.bookmarks.onPortalSelectedPending = true;
setTimeout(function() { // the sidebar is constructed after firing the hook
window.plugin.bookmarks.onPortalSelectedPending = false;
$('.bkmrksStar').remove();
if(typeof(Storage) === "undefined") {
$('#portaldetails > .imgpreview').after(plugin.bookmarks.htmlDisabledMessage);
return;
@ -314,6 +322,8 @@
}, 0);
}
}
// Update the status of the star (when a portal is selected from the map/bookmarks-list)
window.plugin.bookmarks.updateStarPortal = function() {
var guid = window.selectedPortal;