mirror of
https://github.com/Sylius/Sylius.git
synced 2026-07-14 09:02:12 +00:00
Add an alert about unsaved changes
This commit is contained in:
parent
48729b8633
commit
d2ef0b2708
4 changed files with 52 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
"dependencies": {
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"jquery": "^3.4.0",
|
||||
"jquery.dirtyforms": "^2.0.0",
|
||||
"lightbox2": "^2.9.0",
|
||||
"semantic-ui-css": "^2.2.0"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
import 'semantic-ui-css/components/accordion';
|
||||
import $ from 'jquery';
|
||||
import 'jquery.dirtyforms/jquery.dirtyforms';
|
||||
|
||||
import 'sylius/ui/app';
|
||||
import 'sylius/ui/sylius-auto-complete';
|
||||
|
|
@ -27,6 +28,7 @@ import './sylius-product-slug';
|
|||
import './sylius-taxon-slug';
|
||||
|
||||
import SyliusTaxonomyTree from './sylius-taxon-tree';
|
||||
import formsList from './sylius-forms-list';
|
||||
|
||||
$(document).ready(() => {
|
||||
$('#sylius_product_variant_pricingCalculator').handlePrototypes({
|
||||
|
|
@ -101,6 +103,8 @@ $(document).ready(() => {
|
|||
});
|
||||
|
||||
const taxonomyTree = new SyliusTaxonomyTree();
|
||||
|
||||
$(`${formsList}, .check-unsaved`).dirtyForms();
|
||||
});
|
||||
|
||||
window.$ = $;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,39 @@
|
|||
/*
|
||||
* This file is part of the Sylius package.
|
||||
*
|
||||
* (c) Paweł Jędrzejewski
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
export default [
|
||||
'sylius_product',
|
||||
'sylius_taxon',
|
||||
'sylius_product_variant',
|
||||
'sylius_product_generate_variants',
|
||||
'sylius_inventory',
|
||||
'sylius_product_attribute',
|
||||
'sylius_product_option',
|
||||
'sylius_product_association_type',
|
||||
'sylius_customer',
|
||||
'sylius_customer_group',
|
||||
'sylius_promotion',
|
||||
'sylius_promotion_coupon',
|
||||
'sylius_promotion_coupon_generator_instruction',
|
||||
'sylius_product_review',
|
||||
'sylius_channel',
|
||||
'sylius_country',
|
||||
'sylius_zone',
|
||||
'sylius_currency',
|
||||
'sylius_exchange_rate',
|
||||
'sylius_locale',
|
||||
'sylius_payment_method',
|
||||
'sylius_shipping_method',
|
||||
'sylius_shipping_category',
|
||||
'sylius_tax_category',
|
||||
'sylius_tax_rate',
|
||||
'sylius_admin_user',
|
||||
]
|
||||
.map(form => `form[name="${form}"]`)
|
||||
.join(', ');
|
||||
|
|
@ -2920,7 +2920,14 @@ isstream@~0.1.2:
|
|||
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"
|
||||
integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=
|
||||
|
||||
jquery@^3.4.0, jquery@x.*:
|
||||
jquery.dirtyforms@^2.0.0:
|
||||
version "2.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jquery.dirtyforms/-/jquery.dirtyforms-2.0.0.tgz#0a53011595d3d19c2c81c0e91ba0078439ed0d2d"
|
||||
integrity sha1-ClMBFZXT0ZwsgcDpG6AHhDntDS0=
|
||||
dependencies:
|
||||
jquery ">=1.4.2"
|
||||
|
||||
jquery@>=1.4.2, jquery@^3.4.0, jquery@x.*:
|
||||
version "3.4.1"
|
||||
resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.4.1.tgz#714f1f8d9dde4bdfa55764ba37ef214630d80ef2"
|
||||
integrity sha512-36+AdBzCL+y6qjw5Tx7HgzeGCzC81MDDgaUP8ld2zhx58HdqXGoBd+tHdrBMiyjGQs0Hxs/MLZTu/eHNJJuWPw==
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue