mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +00:00
Fixed product picker workflows URLs were wrong when running grocy in a subdirectory (fixes #219)
This commit is contained in:
parent
6442665f6c
commit
b6b8c76d3a
@ -161,7 +161,7 @@ $('#product_id_text_input').on('blur', function(e)
|
|||||||
className: 'btn-success add-new-product-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses,
|
className: 'btn-success add-new-product-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses,
|
||||||
callback: function()
|
callback: function()
|
||||||
{
|
{
|
||||||
window.location.href = U('/product/new?prefillname=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(window.location.pathname));
|
window.location.href = U('/product/new?prefillname=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addbarcode: {
|
addbarcode: {
|
||||||
@ -169,7 +169,7 @@ $('#product_id_text_input').on('blur', function(e)
|
|||||||
className: 'btn-info add-new-barcode-dialog-button responsive-button',
|
className: 'btn-info add-new-barcode-dialog-button responsive-button',
|
||||||
callback: function()
|
callback: function()
|
||||||
{
|
{
|
||||||
window.location.href = U(window.location.pathname + '?addbarcodetoselection=' + encodeURIComponent(input));
|
window.location.href = U(Grocy.CurrentUrlRelative + '?addbarcodetoselection=' + encodeURIComponent(input));
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addnewproductwithbarcode: {
|
addnewproductwithbarcode: {
|
||||||
@ -177,7 +177,7 @@ $('#product_id_text_input').on('blur', function(e)
|
|||||||
className: 'btn-warning add-new-product-with-barcode-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses,
|
className: 'btn-warning add-new-product-with-barcode-dialog-button responsive-button ' + addProductWorkflowsAdditionalCssClasses,
|
||||||
callback: function()
|
callback: function()
|
||||||
{
|
{
|
||||||
window.location.href = U('/product/new?prefillbarcode=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(window.location.pathname));
|
window.location.href = U('/product/new?prefillbarcode=' + encodeURIComponent(input) + '&returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -48,6 +48,7 @@
|
|||||||
Grocy.Components = { };
|
Grocy.Components = { };
|
||||||
Grocy.Mode = '{{ GROCY_MODE }}';
|
Grocy.Mode = '{{ GROCY_MODE }}';
|
||||||
Grocy.BaseUrl = '{{ $U('/') }}';
|
Grocy.BaseUrl = '{{ $U('/') }}';
|
||||||
|
Grocy.CurrentUrlRelative = window.location.pathname.replace(Grocy.BaseUrl, "");
|
||||||
Grocy.LocalizationStrings = {!! json_encode($localizationStrings) !!};
|
Grocy.LocalizationStrings = {!! json_encode($localizationStrings) !!};
|
||||||
Grocy.ActiveNav = '@yield('activeNav', '')';
|
Grocy.ActiveNav = '@yield('activeNav', '')';
|
||||||
Grocy.Culture = '{{ GROCY_CULTURE }}';
|
Grocy.Culture = '{{ GROCY_CULTURE }}';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user