mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Various minor usability refinements
This commit is contained in:
@@ -9,7 +9,16 @@ $("textarea.wysiwyg-editor").summernote({
|
||||
$img = $('<img>').attr({ src: url, class: "img-fluid", loading: "lazy" })
|
||||
$(this).summernote("insertNode", $img[0]);
|
||||
}
|
||||
}
|
||||
},
|
||||
toolbar: [
|
||||
['fontsize', ['fontsize']],
|
||||
['font', ['bold', 'underline', 'clear']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph']],
|
||||
['table', ['table']],
|
||||
['insert', ['link', 'picture', 'video']],
|
||||
['view', ['codeview', 'fullscreen']]
|
||||
]
|
||||
});
|
||||
|
||||
// Summernote workaround: Make embeds responsive
|
||||
|
@@ -62,7 +62,7 @@ function OnBarcodeScanned(barcode)
|
||||
bgClass = "bg-danger";
|
||||
|
||||
$("#miss-count").text(Grocy.BarCodeScannerTestingMissCount);
|
||||
animateCSS("#miss-count", "pulse");
|
||||
animateCSS("#miss-count", "flash");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -70,7 +70,7 @@ function OnBarcodeScanned(barcode)
|
||||
bgClass = "bg-success";
|
||||
|
||||
$("#hit-count").text(Grocy.BarCodeScannerTestingHitCount);
|
||||
animateCSS("#hit-count", "pulse");
|
||||
animateCSS("#hit-count", "flash");
|
||||
}
|
||||
|
||||
$("#scanned_codes").prepend("<option class='" + bgClass + "'>" + barcode + "</option>");
|
||||
|
@@ -84,7 +84,7 @@ $(document).on('click', '.track-charge-cycle-button', function(e)
|
||||
batteryRow.addClass("table-warning");
|
||||
}
|
||||
|
||||
animateCSS("#battery-" + batteryId + "-row td:not(:first)", "shake");
|
||||
animateCSS("#battery-" + batteryId + "-row td:not(:first)", "flash");
|
||||
|
||||
$('#battery-' + batteryId + '-last-tracked-time').text(trackedTime);
|
||||
$('#battery-' + batteryId + '-last-tracked-time-timeago').attr('datetime', trackedTime);
|
||||
|
@@ -146,7 +146,7 @@ $(document).on('click', '.track-chore-button', function(e)
|
||||
$('#chore-' + choreId + '-due-filter-column').html("duesoon");
|
||||
}
|
||||
|
||||
animateCSS("#chore-" + choreId + "-row td:not(:first)", "shake");
|
||||
animateCSS("#chore-" + choreId + "-row td:not(:first)", "flash");
|
||||
|
||||
$('#chore-' + choreId + '-last-tracked-time').text(trackedTime);
|
||||
$('#chore-' + choreId + '-last-tracked-time-timeago').attr('datetime', trackedTime);
|
||||
|
@@ -77,10 +77,12 @@ Grocy.Components.ProductCard.Refresh = function(productId)
|
||||
|
||||
$('#productcard-product-edit-button').attr("href", U("/product/" + productDetails.product.id.toString() + '?' + 'returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative)));
|
||||
$('#productcard-product-journal-button').attr("href", U("/stockjournal?embedded&product=" + productDetails.product.id.toString()));
|
||||
$('#productcard-product-shoppinglist-button').attr("href", U("/shoppinglistitem/new?embedded&updateexistingproduct&list=1&product=" + productDetails.product.id.toString()));
|
||||
$('#productcard-product-stock-button').attr("href", U("/stockentries?embedded&product=" + productDetails.product.id.toString()));
|
||||
$('#productcard-product-stock-button').removeClass("disabled");
|
||||
$('#productcard-product-edit-button').removeClass("disabled");
|
||||
$('#productcard-product-journal-button').removeClass("disabled");
|
||||
$('#productcard-product-shoppinglist-button').removeClass("disabled");
|
||||
|
||||
if (productDetails.last_price !== null)
|
||||
{
|
||||
|
@@ -24,7 +24,7 @@ function RefreshQuPluralTestingResult()
|
||||
return;
|
||||
}
|
||||
|
||||
animateCSS("h2", "shake");
|
||||
animateCSS("h2", "flash");
|
||||
$("#result").text(__n(amount, singularForm, pluralForm, true));
|
||||
}
|
||||
|
||||
|
@@ -219,7 +219,7 @@ function RefreshStockEntryRow(stockRowId)
|
||||
stockRow.addClass("table-warning");
|
||||
}
|
||||
|
||||
animateCSS("#stock-" + stockRowId + "-row td:not(:first)", "shake");
|
||||
animateCSS("#stock-" + stockRowId + "-row td:not(:first)", "flash");
|
||||
|
||||
$('#stock-' + stockRowId + '-amount').text(result.amount);
|
||||
$('#stock-' + stockRowId + '-due-date').text(result.best_before_date);
|
||||
@@ -317,8 +317,11 @@ $(window).on("message", function(e)
|
||||
|
||||
if (data.Message == "ProductChanged")
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
$(".stock-consume-button[data-product-id='" + data.Payload + "']").each(function()
|
||||
{
|
||||
RefreshStockEntryRow($(this).attr("data-stockrow-id"));
|
||||
});
|
||||
};
|
||||
});
|
||||
|
||||
Grocy.Components.ProductPicker.GetPicker().trigger('change');
|
||||
|
@@ -335,7 +335,7 @@ function RefreshProductRow(productId)
|
||||
}
|
||||
else
|
||||
{
|
||||
animateCSS("#product-" + productId + "-row td:not(:first)", "shake");
|
||||
animateCSS("#product-" + productId + "-row td:not(:first)", "flash");
|
||||
|
||||
$('#product-' + productId + '-qu-name').text(__n(result.stock_amount, result.quantity_unit_stock.name, result.quantity_unit_stock.name_plural, true));
|
||||
$('#product-' + productId + '-amount').text(result.stock_amount);
|
||||
@@ -359,6 +359,11 @@ function RefreshProductRow(productId)
|
||||
$(".product-consume-button[data-product-id='" + productId + "']").addClass("disabled");
|
||||
$(".product-open-button[data-product-id='" + productId + "']").addClass("disabled");
|
||||
}
|
||||
else
|
||||
{
|
||||
$(".product-consume-button[data-product-id='" + productId + "']").removeClass("disabled");
|
||||
$(".product-open-button[data-product-id='" + productId + "']").removeClass("disabled");
|
||||
}
|
||||
}
|
||||
|
||||
$('#product-' + productId + '-next-due-date').text(result.next_due_date);
|
||||
|
Reference in New Issue
Block a user