From bc6924fd5d4ac01e3ee6d1fd5806c99b6ebf9ba9 Mon Sep 17 00:00:00 2001 From: eikek Date: Sun, 15 Aug 2021 12:41:10 +0200 Subject: [PATCH] Show delete/restore buttons conditionally When only trashed items are selected, the "delete" button doesn't make sense and vice versa. --- modules/webapp/src/main/elm/Page/Home/View2.elm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/webapp/src/main/elm/Page/Home/View2.elm b/modules/webapp/src/main/elm/Page/Home/View2.elm index dbbff10f..ca0bc60a 100644 --- a/modules/webapp/src/main/elm/Page/Home/View2.elm +++ b/modules/webapp/src/main/elm/Page/Home/View2.elm @@ -16,6 +16,7 @@ import Comp.SearchMenu import Comp.SearchStatsView import Data.Flags exposing (Flags) import Data.ItemSelection +import Data.SearchMode import Data.UiSettings exposing (UiSettings) import Html exposing (..) import Html.Attributes exposing (..) @@ -78,6 +79,7 @@ confirmModal texts model = texts.basics.yes texts.basics.no texts.reallyDeleteQuestion + ConfirmRestore -> Comp.ConfirmModal.defaultSettings RestoreSelectedConfirmed @@ -85,7 +87,6 @@ confirmModal texts model = texts.basics.yes texts.basics.no texts.reallyRestoreQuestion - in case model.viewMode of SelectView svm -> @@ -270,6 +271,7 @@ editMenuBar texts model svm = , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", svm.action == DeleteSelected ) + , ( "hidden", model.searchMenuModel.searchMode == Data.SearchMode.Trashed ) ] } , MB.CustomButton @@ -280,6 +282,7 @@ editMenuBar texts model svm = , inputClass = [ ( btnStyle, True ) , ( "bg-gray-200 dark:bg-bluegray-600", svm.action == RestoreSelected ) + , ( "hidden", model.searchMenuModel.searchMode == Data.SearchMode.Normal ) ] } ]