diff --git a/public/viewjs/shoppinglist.js b/public/viewjs/shoppinglist.js index e655a747..ce3d962a 100644 --- a/public/viewjs/shoppinglist.js +++ b/public/viewjs/shoppinglist.js @@ -307,5 +307,28 @@ OnListItemRemoved(); $(document).on("click", "#print-shopping-list-button", function(e) { $(".print-timestamp").text(moment().format("l LT")); + $("#description-for-print").html($("#description").val()); window.print(); }); + +$("#description").on("summernote.change", function() +{ + $("#save-description-button").removeClass("disabled"); +}); + +$(document).on("click", "#save-description-button", function(e) +{ + e.preventDefault(); + document.activeElement.blur(); + + Grocy.Api.Put('objects/shopping_lists/' + $("#selected-shopping-list").val(), { description: $("#description").val() }, + function(result) + { + $("#save-description-button").addClass("disabled"); + }, + function(xhr) + { + console.log(xhr); + } + ); +}); diff --git a/views/shoppinglist.blade.php b/views/shoppinglist.blade.php index 04526872..74ae8d6e 100644 --- a/views/shoppinglist.blade.php +++ b/views/shoppinglist.blade.php @@ -142,6 +142,16 @@ +
+
+
+ + {{ $__t('Save') }} + +
+
+
+ @stop diff --git a/views/shoppinglistform.blade.php b/views/shoppinglistform.blade.php index 34206bab..c291daba 100644 --- a/views/shoppinglistform.blade.php +++ b/views/shoppinglistform.blade.php @@ -27,11 +27,6 @@
{{ $__t('A name is required') }}
-
- - -
-