From 3e4992f9153c5b97169dfcdfe03cb6c280479f0d Mon Sep 17 00:00:00 2001 From: Tobias Bachmann Date: Tue, 10 Dec 2024 13:26:46 +0100 Subject: [PATCH] ftr/PartsInGoToMenu: fix wrong handling if there are no parts in source due changes in last commit (10ba464) the array also exist if there are no parts, therefore its necessary to check for its lenght and not existence --- app/view/window/source/SourceView.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/view/window/source/SourceView.js b/app/view/window/source/SourceView.js index c03fbef24..bdb4e6fae 100644 --- a/app/view/window/source/SourceView.js +++ b/app/view/window/source/SourceView.js @@ -255,7 +255,7 @@ Ext.define('EdiromOnline.view.window.source.SourceView', { // iterate over submitted movements and push them to movementItems variable movements.data.each(function(movement) { - if(movement.data.parts === null) { + if(movement.data.parts.length === 0) { movementItems.push({ text: movement.get('name'), handler: Ext.bind(me.gotoMovement, me, movement.get('id'), true) @@ -308,7 +308,6 @@ Ext.define('EdiromOnline.view.window.source.SourceView', { }); } - // check if contains more than one item and save to variable as boolean var isDisabled = ((movementItems.length < 1) ? true : false);