mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Optimized returnto-links handling (fixes #1785)
This commit is contained in:
parent
d38a5efb3d
commit
2457c2c2fd
@ -883,11 +883,11 @@ $('a.link-return').not(".btn").each(function()
|
||||
var base = $(this).data('href');
|
||||
if (base.contains('?'))
|
||||
{
|
||||
$(this).attr('href', base + '&returnto' + encodeURIComponent(location.pathname));
|
||||
$(this).attr('href', base + '&returnto' + encodeURIComponent(Grocy.CurrentUrlRelative));
|
||||
}
|
||||
else
|
||||
{
|
||||
$(this).attr('href', base + '?returnto=' + encodeURIComponent(location.pathname));
|
||||
$(this).attr('href', base + '?returnto=' + encodeURIComponent(Grocy.CurrentUrlRelative));
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -195,9 +195,9 @@
|
||||
href="{{ $U('/stockjournal/summary?embedded&product=') }}{{ $stockEntry->product_id }}">
|
||||
{{ $__t('Stock journal summary') }}
|
||||
</a>
|
||||
<a class="dropdown-item"
|
||||
<a class="dropdown-item link-return"
|
||||
type="button"
|
||||
href="{{ $U('/product/') }}{{ $stockEntry->product_id . '?returnto=/stockentries' }}">
|
||||
data-href="{{ $U('/product/') }}{{ $stockEntry->product_id }}">
|
||||
{{ $__t('Edit product') }}
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
|
@ -291,9 +291,9 @@
|
||||
href="{{ $U('/stockjournal/summary?embedded&product_id=') }}{{ $currentStockEntry->product_id }}">
|
||||
<span class="dropdown-item-text">{{ $__t('Stock journal summary') }}</span>
|
||||
</a>
|
||||
<a class="dropdown-item permission-MASTER_DATA_EDIT"
|
||||
<a class="dropdown-item permission-MASTER_DATA_EDIT link-return"
|
||||
type="button"
|
||||
href="{{ $U('/product/') }}{{ $currentStockEntry->product_id . '?returnto=%2Fstockoverview' }}">
|
||||
data-href="{{ $U('/product/') }}{{ $currentStockEntry->product_id }}">
|
||||
<span class="dropdown-item-text">{{ $__t('Edit product') }}</span>
|
||||
</a>
|
||||
<div class="dropdown-divider"></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user