diff --git a/localization/strings.pot b/localization/strings.pot index 8b9338d7..bb9a7ece 100644 --- a/localization/strings.pot +++ b/localization/strings.pot @@ -1777,3 +1777,12 @@ msgstr "" msgid "Mark this stock entry as open" msgstr "" + +msgid "Mark this item as done" +msgstr "" + +msgid "Edit this item" +msgstr "" + +msgid "Delete this item" +msgstr "" diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index dbcb9ada..867992eb 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -92,6 +92,10 @@ $(document).on('click', '.shoppinglist-delete-button', function(e) { e.preventDefault(); + // Remove the focus from the current button + // to prevent that the tooltip stays until clicked anywhere else + document.activeElement.blur(); + var shoppingListItemId = $(e.currentTarget).attr('data-shoppinglist-id'); Grocy.FrontendHelpers.BeginUiBusy(); @@ -173,6 +177,10 @@ $(document).on('click', '.shopping-list-stock-add-workflow-list-item-button', fu { e.preventDefault(); + // Remove the focus from the current button + // to prevent that the tooltip stays until clicked anywhere else + document.activeElement.blur(); + var href = $(e.currentTarget).attr('href'); $("#shopping-list-stock-add-workflow-purchase-form-frame").attr("src", href); @@ -248,6 +256,10 @@ $(document).on('click', '.order-listitem-button', function(e) { e.preventDefault(); + // Remove the focus from the current button + // to prevent that the tooltip stays until clicked anywhere else + document.activeElement.blur(); + Grocy.FrontendHelpers.BeginUiBusy(); var listItemId = $(e.currentTarget).attr('data-item-id'); diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index 315c51c1..90809d9f 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -119,13 +119,16 @@ + data-item-done="{{ $listItem->done }}" + data-toggle="tooltip" data-placement="right" title="{{ $__t('Mark this item as done') }}"> - + - + product_id)) data-toggle="tooltip" title="{{ $__t('Add %1$s of %2$s to stock', $listItem->amount . ' ' . $__n($listItem->amount, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name, FindObjectInArrayByPropertyValue($quantityunits, 'id', FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->qu_id_purchase)->name_plural), FindObjectInArrayByPropertyValue($products, 'id', $listItem->product_id)->name, $listItem->amount) }}" @endif>