2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-19 05:25:42 +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

@ -28,7 +28,7 @@
$('#bom-table').on('click', '.delete-button', function () {
var button = $(this);
launchDeleteForm("#modal-delete",
launchDeleteForm(
button.attr('url'),
{
success: reloadBom
@ -38,7 +38,7 @@
$("#bom-table").on('click', '.edit-button', function () {
var button = $(this);
launchModalForm("#modal-form",
launchModalForm(
button.attr('url'),
{
success: reloadBom
@ -47,7 +47,7 @@
});
$("#new-bom-item").click(function () {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'bom-item-create' %}",
{
reload: true,

View File

@ -40,7 +40,7 @@
{% block js_ready %}
{{ block.super }}
$("#start-build").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'build-create' %}",
{
follow: true,

View File

@ -53,7 +53,7 @@
{{ block.super }}
$("#cat-create").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'category-create' %}",
{
follow: true,
@ -66,7 +66,7 @@
})
$("#part-create").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'part-create' %}",
{
follow: true,
@ -80,7 +80,7 @@
{% if category %}
$("#cat-edit").click(function () {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'category-edit' category.id %}",
{
reload: true
@ -96,8 +96,7 @@
{% endif %}
$('#cat-delete').click(function() {
launchDeleteForm('#modal-delete',
"{% url 'category-delete' category.id %}",
launchDeleteForm("{% url 'category-delete' category.id %}",
{
redirect: redirect
});

View File

@ -102,7 +102,7 @@
{% block js_ready %}
{{ block.super }}
$("#edit-part").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'part-edit' part.id %}",
{
reload: true,
@ -110,7 +110,7 @@
});
$('#delete-part').click(function() {
launchDeleteForm("#modal-delete",
launchDeleteForm(
"{% url 'part-delete' part.id %}",
{
redirect: {% if part.category %}"{% url 'category-detail' part.category.id %}"{% else %}"{% url 'part-index' %}"{% endif %}

View File

@ -81,7 +81,7 @@
{% block js_ready %}
{{ block.super }}
$("#part-thumb").click(function() {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'part-image' part.id %}",
{
reload: true

View File

@ -42,7 +42,7 @@
{{ block.super }}
$('#add-stock-item').click(function () {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'stock-item-create' %}",
{
reload: true,

View File

@ -29,7 +29,7 @@
{{ block.super }}
$('#supplier-create').click(function () {
launchModalForm("#modal-form",
launchModalForm(
"{% url 'supplier-part-create' %}",
{
reload: true,