mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 17:45:39 +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');
|
var base = $(this).data('href');
|
||||||
if (base.contains('?'))
|
if (base.contains('?'))
|
||||||
{
|
{
|
||||||
$(this).attr('href', base + '&returnto' + encodeURIComponent(location.pathname));
|
$(this).attr('href', base + '&returnto' + encodeURIComponent(Grocy.CurrentUrlRelative));
|
||||||
}
|
}
|
||||||
else
|
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 }}">
|
href="{{ $U('/stockjournal/summary?embedded&product=') }}{{ $stockEntry->product_id }}">
|
||||||
{{ $__t('Stock journal summary') }}
|
{{ $__t('Stock journal summary') }}
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item"
|
<a class="dropdown-item link-return"
|
||||||
type="button"
|
type="button"
|
||||||
href="{{ $U('/product/') }}{{ $stockEntry->product_id . '?returnto=/stockentries' }}">
|
data-href="{{ $U('/product/') }}{{ $stockEntry->product_id }}">
|
||||||
{{ $__t('Edit product') }}
|
{{ $__t('Edit product') }}
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
@ -291,9 +291,9 @@
|
|||||||
href="{{ $U('/stockjournal/summary?embedded&product_id=') }}{{ $currentStockEntry->product_id }}">
|
href="{{ $U('/stockjournal/summary?embedded&product_id=') }}{{ $currentStockEntry->product_id }}">
|
||||||
<span class="dropdown-item-text">{{ $__t('Stock journal summary') }}</span>
|
<span class="dropdown-item-text">{{ $__t('Stock journal summary') }}</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item permission-MASTER_DATA_EDIT"
|
<a class="dropdown-item permission-MASTER_DATA_EDIT link-return"
|
||||||
type="button"
|
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>
|
<span class="dropdown-item-text">{{ $__t('Edit product') }}</span>
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-divider"></div>
|
<div class="dropdown-divider"></div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user