Skip to content

Commit

Permalink
Do not hide or show elements which are force to be hidden in mobile view
Browse files Browse the repository at this point in the history
- We specifically hide some section or elements in mobile view
- if we go level up or level down in mobile view, we should not change the state of those elements which already hidden using css rules
- this patch will cover that part of issue where we do not consider elements which are hidden by css rules
Signed-off-by: Darshan-upadhyay1110 <darshan.upadhyay@collabora.com>
Change-Id: I7ffd83c5b74987f74b7e327fd13775a81d02120d
  • Loading branch information
Darshan-upadhyay1110 committed Mar 8, 2024
1 parent b19a3fa commit 9bfe45f
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions browser/src/control/Control.MobileWizardWindow.js
Expand Up @@ -228,12 +228,12 @@ L.Control.MobileWizardWindow = L.Control.extend({

$('#mobile-wizard .ui-effects-placeholder').hide();

var nodesToHide = $(contentToShow).siblings().not('.mobile-wizard-scroll-indicator');
// do not select already hidden nodes at first place
var nodesToHide = $(contentToShow).siblings(':visible').not('.mobile-wizard-scroll-indicator');

var parent = $(contentToShow).parent();
if (parent.hasClass('toolbox'))
nodesToHide = nodesToHide.add(parent.siblings().not('.mobile-wizard-scroll-indicator'));

nodesToHide = nodesToHide.add(parent.siblings(':visible:not(.mobile-wizard-scroll-indicator)'));
var duration = 10;
if (animate) {
nodesToHide.hide('slide', { direction: 'left' }, duration);
Expand Down Expand Up @@ -299,13 +299,21 @@ L.Control.MobileWizardWindow = L.Control.extend({
this._customTitle ? this._setCustomTitle(this._customTitle) : this._setTitle(this._mainTitle);

var currentNode = $('.ui-explorable-entry.level-' + this._currentDepth + '.mobile-wizard:visible');
var headers = currentNode.siblings();
// select only those nodes which are updated on Level down
var headers = currentNode.siblings().filter(function() {
return $(this).attr('style') === 'display: none;';
});
var currentHeader = currentNode.children('.ui-header');
headers = headers.add(currentHeader);

var parent = currentNode.parent();
if (parent.hasClass('toolbox'))
headers = headers.add(parent.siblings());
parent.siblings().each(function() {
// select only those nodes which are updated on Level down
if ($(this).attr('style') === 'display: none;') {
headers = headers.add($(this));
}
});

headers = headers.not('.hidden');

Expand Down

0 comments on commit 9bfe45f

Please sign in to comment.