mirror of
https://github.com/grocy/grocy.git
synced 2026-04-07 05:16:15 +02:00
Embedded popup for product group add/edit
This commit is contained in:
parent
9b388247da
commit
eb9f569080
|
|
@ -13,7 +13,7 @@
|
|||
Grocy.EditObjectId = result.created_object_id;
|
||||
Grocy.Components.UserfieldsForm.Save(function()
|
||||
{
|
||||
window.location.href = U('/productgroups');
|
||||
window.parent.postMessage(WindowMessageBag("CloseAllModals"), U("/productgroups"));
|
||||
});
|
||||
},
|
||||
function(xhr)
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
{
|
||||
Grocy.Components.UserfieldsForm.Save(function()
|
||||
{
|
||||
window.location.href = U('/productgroups');
|
||||
window.parent.postMessage(WindowMessageBag("CloseAllModals"), U("/productgroups"));
|
||||
});
|
||||
},
|
||||
function(xhr)
|
||||
|
|
|
|||
|
|
@ -55,3 +55,12 @@ $(document).on('click', '.product-group-delete-button', function(e)
|
|||
}
|
||||
});
|
||||
});
|
||||
$(window).on("message", function(e)
|
||||
{
|
||||
var data = e.originalEvent.data;
|
||||
|
||||
if (data.Message === "CloseAllModals")
|
||||
{
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
<hr>
|
||||
<div class="row mt-3">
|
||||
<div class="col-xs-12 col-md-2 col-xl-1">
|
||||
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3" href="{{ $U('/productgroup/new') }}">
|
||||
<a class="btn btn-primary btn-sm responsive-button w-100 mb-3 show-as-dialog-link" href="{{ $U('/productgroup/new?embedded') }}">
|
||||
{{ $__t('Add') }}
|
||||
</a>
|
||||
</div>
|
||||
|
|
@ -55,7 +55,7 @@
|
|||
@foreach($productGroups as $productGroup)
|
||||
<tr>
|
||||
<td class="fit-content border-right">
|
||||
<a class="btn btn-info btn-sm" href="{{ $U('/productgroup/') }}{{ $productGroup->id }}">
|
||||
<a class="btn btn-info btn-sm show-as-dialog-link" href="{{ $U('/productgroup/') }}{{ $productGroup->id }}?embedded">
|
||||
<i class="fas fa-edit"></i>
|
||||
</a>
|
||||
<a class="btn btn-danger btn-sm product-group-delete-button" href="#" data-group-id="{{ $productGroup->id }}" data-group-name="{{ $productGroup->name }}">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user