2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-14 19:15:41 +00:00

Simplified modal calls

- Default modal target supplied (can be overridden in options)
This commit is contained in:
Oliver
2018-05-08 19:55:39 +10:00
parent c5155d5ac7
commit 3f1c6e2059
16 changed files with 55 additions and 43 deletions

View File

@ -132,7 +132,7 @@
{% block js_ready %}
{{ block.super }}
$("#stock-edit").click(function () {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'stock-item-edit' item.id %}",
{
reload: true
@ -141,7 +141,7 @@
{% if item.in_stock %}
$("#stock-move").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'stock-item-move' item.id %}",
{
reload: true,
@ -149,7 +149,7 @@
});
$("#stock-stocktake").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'stock-item-stocktake' item.id %}",
{
reload: true
@ -159,7 +159,7 @@
{% endif %}
$("#stock-delete").click(function () {
launchDeleteForm("#modal-delete",
launchDeleteForm(
"{% url 'stock-item-delete' item.id %}",
{
redirect: "{% url 'part-stock' item.part.id %}"

View File

@ -65,8 +65,7 @@
{% block js_ready %}
{{ block.super }}
$('#location-create').click(function () {
launchModalForm("#modal-form",
"{% url 'stock-location-create' %}",
launchModalForm("{% url 'stock-location-create' %}",
{
data: {
{% if location %}
@ -80,8 +79,7 @@
{% if location %}
$('#location-edit').click(function() {
launchModalForm("#modal-form",
"{% url 'stock-location-edit' location.id %}",
launchModalForm("{% url 'stock-location-edit' location.id %}",
{
reload: true
});
@ -89,8 +87,7 @@
});
$('#location-delete').click(function() {
launchDeleteForm("#modal-delete",
"{% url 'stock-location-delete' location.id %}",
launchDeleteForm("{% url 'stock-location-delete' location.id %}",
{
redirect: "{% url 'stock-index' %}"
});
@ -100,8 +97,7 @@
{% endif %}
$('#item-create').click(function () {
launchModalForm("#modal-form",
"{% url 'stock-item-create' %}",
launchModalForm("{% url 'stock-item-create' %}",
{
success: function() {
$("#stock-table").bootstrapTable('refresh');