mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Load userobject forms in dialogs
This commit is contained in:
@@ -15,7 +15,14 @@
|
|||||||
Grocy.EditObjectId = result.created_object_id;
|
Grocy.EditObjectId = result.created_object_id;
|
||||||
Grocy.Components.UserfieldsForm.Save(function()
|
Grocy.Components.UserfieldsForm.Save(function()
|
||||||
{
|
{
|
||||||
window.location.href = U('/userobjects/' + Grocy.EditObjectParentName);
|
if (GetUriParam("embedded") !== undefined)
|
||||||
|
{
|
||||||
|
window.parent.postMessage(WindowMessageBag("Reload"), Grocy.BaseUrl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
window.location.href = U('/userobjects/' + Grocy.EditObjectParentName);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(xhr)
|
function(xhr)
|
||||||
@@ -32,7 +39,14 @@
|
|||||||
{
|
{
|
||||||
Grocy.Components.UserfieldsForm.Save(function()
|
Grocy.Components.UserfieldsForm.Save(function()
|
||||||
{
|
{
|
||||||
window.location.href = U('/userobjects/' + Grocy.EditObjectParentName);
|
if (GetUriParam("embedded") !== undefined)
|
||||||
|
{
|
||||||
|
window.parent.postMessage(WindowMessageBag("Reload"), Grocy.BaseUrl);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
window.location.href = U('/userobjects/' + Grocy.EditObjectParentName);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
function(xhr)
|
function(xhr)
|
||||||
|
@@ -30,8 +30,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100 m-1 mt-md-0 mb-md-0 float-right"
|
<div class="related-links collapse d-md-flex order-2 width-xs-sm-100 m-1 mt-md-0 mb-md-0 float-right"
|
||||||
id="related-links">
|
id="related-links">
|
||||||
<a class="btn btn-primary responsive-button mr-1"
|
<a class="btn btn-primary responsive-button mr-1 show-as-dialog-link"
|
||||||
href="{{ $U('/userobject/' . $userentity->name . '/new') }}">
|
href="{{ $U('/userobject/' . $userentity->name . '/new?embedded') }}">
|
||||||
{{ $__t('Add') }}
|
{{ $__t('Add') }}
|
||||||
</a>
|
</a>
|
||||||
<a class="btn btn-outline-secondary d-print-none"
|
<a class="btn btn-outline-secondary d-print-none"
|
||||||
@@ -87,8 +87,8 @@
|
|||||||
@foreach($userobjects as $userobject)
|
@foreach($userobjects as $userobject)
|
||||||
<tr>
|
<tr>
|
||||||
<td class="fit-content border-right d-print-none">
|
<td class="fit-content border-right d-print-none">
|
||||||
<a class="btn btn-info btn-sm"
|
<a class="btn btn-info btn-sm show-as-dialog-link"
|
||||||
href="{{ $U('/userobject/' . $userentity->name . '/') }}{{ $userobject->id }}"
|
href="{{ $U('/userobject/' . $userentity->name . '/') }}{{ $userobject->id }}?embedded"
|
||||||
data-toggle="tooltip"
|
data-toggle="tooltip"
|
||||||
title="{{ $__t('Edit this item') }}">
|
title="{{ $__t('Edit this item') }}">
|
||||||
<i class="fas fa-edit"></i>
|
<i class="fas fa-edit"></i>
|
||||||
|
Reference in New Issue
Block a user