mirror of
https://github.com/grocy/grocy.git
synced 2025-08-09 15:48:45 +00:00
Optimized product edit page default button handling (closes #1276)
This commit is contained in:
parent
70433aace5
commit
cdf6ac78e2
@ -229,7 +229,7 @@ $('#product-form input').keydown(function(event)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$('#save-product-button').click();
|
$('.default-submit-button').click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -538,3 +538,8 @@ Grocy.Components.ProductPicker.GetPicker().on('change', function(e)
|
|||||||
|
|
||||||
Grocy.FrontendHelpers.ValidateForm("product-form");
|
Grocy.FrontendHelpers.ValidateForm("product-form");
|
||||||
Grocy.Components.ProductPicker.GetPicker().trigger("change");
|
Grocy.Components.ProductPicker.GetPicker().trigger("change");
|
||||||
|
|
||||||
|
if (Grocy.EditMode == "edit")
|
||||||
|
{
|
||||||
|
$(".save-product-button").toggleClass("default-submit-button");
|
||||||
|
}
|
||||||
|
@ -478,7 +478,7 @@
|
|||||||
class="my-2 form-text text-muted @if($mode == 'edit') d-none @endif">{{ $__t('Save & continue to add quantity unit conversions & barcodes') }}</small>
|
class="my-2 form-text text-muted @if($mode == 'edit') d-none @endif">{{ $__t('Save & continue to add quantity unit conversions & barcodes') }}</small>
|
||||||
|
|
||||||
<button id="save-product-button"
|
<button id="save-product-button"
|
||||||
class="save-product-button btn btn-success mb-2"
|
class="save-product-button btn btn-success mb-2 default-submit-button"
|
||||||
data-location="continue">{{ $__t('Save & continue') }}</button>
|
data-location="continue">{{ $__t('Save & continue') }}</button>
|
||||||
<button class="save-product-button btn btn-info mb-2"
|
<button class="save-product-button btn btn-info mb-2"
|
||||||
data-location="return">{{ $__t('Save & return to products') }}</button>
|
data-location="return">{{ $__t('Save & return to products') }}</button>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user