Skip to content

Commit

Permalink
render details: select if forced or not selected
Browse files Browse the repository at this point in the history
  • Loading branch information
le-jeu committed Feb 19, 2021
1 parent 4d77f51 commit bb5e120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions core/code/portal_detail_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ window.resetScrollOnNewPortal = function() {
}
};

window.renderPortalDetails = function(guid, dontSelect) {
if (!dontSelect) selectPortal(window.portals[guid] ? guid : null, 'renderPortalDetails');
window.renderPortalDetails = function(guid, forceSelect) {
if (forceSelect || selectedPortal !== guid)
selectPortal(window.portals[guid] ? guid : null, 'renderPortalDetails');
if ($('#sidebar').is(':visible')) {
window.resetScrollOnNewPortal();
window.renderPortalDetails.lastVisible = guid;
Expand Down
8 changes: 4 additions & 4 deletions core/code/portal_marker.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ var portalBaseStyle = {
// portal hooks
function handler_portal_click (e) {
window.selectPortal(e.target.options.guid, e.type);
window.renderPortalDetails(e.target.options.guid, true)
window.renderPortalDetails(e.target.options.guid)
}
function handler_portal_dblclick (e) {
window.selectPortal(e.target.options.guid, e.type);
window.renderPortalDetails(e.target.options.guid, true)
window.renderPortalDetails(e.target.options.guid)
window.map.setView(e.target.getLatLng(), DEFAULT_ZOOM);
}
function handler_portal_contextmenu (e) {
window.selectPortal(e.target.options.guid, e.type);
window.renderPortalDetails(e.target.options.guid, true)
window.renderPortalDetails(e.target.options.guid)
if (window.isSmartphone()) {
window.show('info');
} else if (!$('#scrollwrapper').is(':visible')) {
Expand Down Expand Up @@ -135,7 +135,7 @@ L.PortalMarker = L.CircleMarker.extend({
renderDetails() {
if (!this._rendering) {
this._rendering = true;
renderPortalDetails(this._details.guid, true);
renderPortalDetails(this._details.guid);
this._rendering = false;
}
},
Expand Down

0 comments on commit bb5e120

Please sign in to comment.