From 6197b259595b2c014e8a2c169cd5ebcceed8a40a Mon Sep 17 00:00:00 2001 From: Michael Meeks Date: Thu, 20 Feb 2020 03:24:29 +0000 Subject: [PATCH] mend removal of adjacent jsdialog wizard items by name. Change-Id: Id91a58cde7581d23aeb82a95f26a1c0e1352e411 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/89067 Tested-by: Michael Meeks Reviewed-by: Michael Meeks --- loleaflet/src/control/Control.MobileWizard.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js index de54a6d71..300f21773 100644 --- a/loleaflet/src/control/Control.MobileWizard.js +++ b/loleaflet/src/control/Control.MobileWizard.js @@ -399,7 +399,7 @@ L.Control.MobileWizard = L.Control.extend({ _removeItems: function (data, items) { if (data.children) { - for (var i = 0; i < data.children.length; i++) { + for (var i = 0; i < data.children.length;) { var childRemoved = false; for (var j = 0; j < items.length; j++) { if (data.children[i].id === items[j]) { @@ -408,10 +408,12 @@ L.Control.MobileWizard = L.Control.extend({ break; } } - if (childRemoved && i > 0) - i = i - 1; - if (data.children[i]) - this._removeItems(data.children[i], items); + if (!childRemoved) + { + if (data.children[i]) + this._removeItems(data.children[i], items); + i++; + } } } },