mobile_wizard: Simplify code

We don't need to return with two children in _removeStylesPanelAndGetContent()
method if we use only the first one in _addChildrenToTextPanel() method.

Change-Id: I11137ce0620e86ad7d2c5ebcaba752f3171b96e0
This commit is contained in:
Tamás Zolnai 2019-10-10 12:06:42 +02:00
parent 357f802051
commit 3f710955ba

View file

@ -163,7 +163,7 @@ L.Control.MobileWizard = L.Control.extend({
for (var i = 0; i < data.children.length; i++) {
if (data.children[i].type === 'panel' && data.children[i].children &&
data.children[i].children.length > 0 && data.children[i].children[0].id === 'SidebarStylesPanel') {
var ret = [data.children[i].children[0].children, data.children[i+1].children[0].children];
var ret = data.children[i].children[0].children;
data.children.splice(i, 2);
return ret;
}
@ -180,7 +180,7 @@ L.Control.MobileWizard = L.Control.extend({
_addChildrenToTextPanel: function (data, children) {
if (data.id === 'SidebarTextPanel' && data.children && data.children.length > 0 &&
data.children[0].children && data.children[0].children.length > 0) {
data.children[0].children = children[0].concat(data.children[0].children);
data.children[0].children = children.concat(data.children[0].children);
data.children[0].children[0].id = 'box42';
return 'success';
}