mirror of
https://github.com/grocy/grocy.git
synced 2026-04-06 21:06:15 +02:00
Fixed (broken by myself) link-return handling
This commit is contained in:
parent
ddfe608ec6
commit
849d3dd0ca
|
|
@ -670,7 +670,7 @@ $(Grocy.UserPermissions).each(function (index, item)
|
|||
$('.permission-'+item.permission_name).addClass('disabled').addClass('not-allowed');
|
||||
}
|
||||
});
|
||||
$('a.link-return').each(function () {
|
||||
$('a.link-return').not(".btn").each(function () {
|
||||
var base = $(this).data('href');
|
||||
if(base.contains('?'))
|
||||
{
|
||||
|
|
@ -681,3 +681,18 @@ $('a.link-return').each(function () {
|
|||
}
|
||||
|
||||
})
|
||||
|
||||
$(document).on("click", "a.btn.link-return", function(e)
|
||||
{
|
||||
e.preventDefault();
|
||||
|
||||
var link = GetUriParam("returnto");
|
||||
if (!link || !link.length > 0)
|
||||
{
|
||||
location.href = $(e.currentTarget).attr("href");
|
||||
}
|
||||
else
|
||||
{
|
||||
location.href = U(link);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</select>
|
||||
</div>
|
||||
|
||||
<a href="{{ $U('/') }}" class="btn btn-success">{{ $__t('OK') }}</a>
|
||||
<a href="{{ $U('/') }}" class="btn btn-success link-return">{{ $__t('OK') }}</a>
|
||||
</div>
|
||||
</div>
|
||||
@stop
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user