Skip to content

Commit 3f87c97

Browse files
committed
Fix #21610 - replace inline js with x-magento-init
1 parent 7fac8a3 commit 3f87c97

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
1-
<script>
2-
require(
3-
['jquery'],
4-
function ($) {
5-
$(document).on('save', 'form#edit_form', function () {
6-
if ($(this).valid()) {
7-
$('body').trigger('processStart');
8-
}
9-
});
1+
<script type="text/x-magento-init">
2+
{
3+
"#edit_form": {
4+
"Magento_Sitemap/js/form-submit-loader" : {}
105
}
11-
)
6+
}
127
</script>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery'
8+
], function ($) {
9+
'use strict';
10+
11+
return function (data, element) {
12+
13+
$(element).on('save', function () {
14+
if ($(this).valid()) {
15+
$('body').trigger('processStart');
16+
}
17+
});
18+
};
19+
});

0 commit comments

Comments
 (0)