From ba8aa8cffca53e3cdf60c0c6134c52b9d56017fa Mon Sep 17 00:00:00 2001 From: Shweelan Samson Date: Tue, 9 Apr 2019 14:14:17 +0300 Subject: [PATCH] Fix push files disabled button --- ui/drawer-component.ts | 43 +++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/ui/drawer-component.ts b/ui/drawer-component.ts index 3ab3889..6796ff8 100644 --- a/ui/drawer-component.ts +++ b/ui/drawer-component.ts @@ -88,14 +88,7 @@ function renderStagingDownload(task): Children { ].map(t => m( "option", - { - disabled: !t, - value: t, - selected: (task.fileType || "") === t, - onclick: () => { - task.fileType = t; - } - }, + { disabled: !t, value: t, selected: (task.fileType || "") === t }, t ) ); @@ -114,17 +107,7 @@ function renderStagingDownload(task): Children { .map(f => m( "option", - { - disabled: !f, - value: f, - selected: (task.fileName || "") === f, - onclick: () => { - task.fileName = f; - task.fileType = ""; - for (const file of files.value) - if (file._id === f) task.fileType = file["metadata.fileType"]; - } - }, + { disabled: !f, value: f, selected: (task.fileName || "") === f }, f ) ); @@ -133,11 +116,29 @@ function renderStagingDownload(task): Children { "Push ", m( "select", - { disabled: files.fulfilling, style: "width: 350px" }, + { + onchange: e => { + const f = e.target.value; + task.fileName = f; + task.fileType = ""; + for (const file of files.value) + if (file._id === f) task.fileType = file["metadata.fileType"]; + }, + disabled: files.fulfilling, + style: "width: 350px" + }, filesList ), " as ", - m("select", typesList) + m( + "select", + { + onchange: e => { + task.fileType = e.target.value; + } + }, + typesList + ) ]; }