Skip to content

Commit

Permalink
fix(mobileWizard): stop highlighting on close
Browse files Browse the repository at this point in the history
Way-back-when, we deselected the toolbar button when the mobile
wizard was closed. We stopped doing this during the leaflet migration
because the functions we previously used to do it no longer existed
(I652a163ea0c831b47ce7725ffd0f9f190a98d9bf). Instead, we can use whether
the 'selected' class is on our elements in the DOM to see if they should
be unchecked.

That change had far more '.uncheck(...)' and '.check(...)' than I've
set up here, and some of those may be necessary, but this was the bug
I knew about and I didn't want to poke around with things that I wasn't
completely sure where I was changing.

Signed-off-by: Skyler Grey <[email protected]>
Change-Id: I737693f6db96c8298c07b195aa374a1bbb670108
  • Loading branch information
Minion3665 committed Jan 29, 2025
1 parent 0826112 commit c15d473
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions browser/src/control/Control.MobileWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ L.Control.MobileWizard = L.Control.extend({
},

_updateToolbarItemStateByClose: function() {
var toolbar = app.map.mobileTopBar;
if (toolbar)
{
//if (window.mobileWizard === false && toolbar.get('mobile_wizard').checked)
// toolbar.uncheck('mobile_wizard');

//if (window.insertionMobileWizard === false && toolbar.get('insertion_mobile_wizard').checked)
// toolbar.uncheck('insertion_mobile_wizard');
//if (window.commentWizard === false && toolbar.get('comment_wizard').checked)
// toolbar.uncheck('comment_wizard');
}
const mobileWizard = document.getElementById('mobile_wizard');
if (window.mobileWizard === false && mobileWizard && mobileWizard.classList.contains('selected'))
mobileWizard.classList.remove('selected');

const insertionMobileWizard = document.getElementById('insertion_mobile_wizard');
if (window.insertionMobileWizard === false && insertionMobileWizard && insertionMobileWizard.classList.contains('selected'))
insertionMobileWizard.classList.remove('selected');

const commentWizard = document.getElementById('comment_wizard');
if (window.commentWizard === false && commentWizard && commentWizard.classList.contains('selected'))
commentWizard.classList.remove('selected');
},

goLevelDown: function(contentToShow, options) {
Expand Down

0 comments on commit c15d473

Please sign in to comment.