Skip to content

Commit 779ddd8

Browse files
author
Stanislav Idolov
authored
ENGCOM-1698: [Forwardport] Format the javascript code in Tax module #15560
2 parents d26ad7d + 3ae101a commit 779ddd8

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

app/code/Magento/Tax/view/adminhtml/templates/class/page/edit.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?= $block->getSaveButtonHtml() ?>
1212
</div>
1313
<?= $block->getRenameFormHtml() ?>
14-
<script>
15-
require(['jquery', "mage/mage"], function(jQuery){
16-
17-
jQuery('#<?= /* @escapeNotVerified */ $block->getRenameFormId() ?>').mage('form').mage('validation');
18-
19-
});
14+
<script type="text/x-magento-init">
15+
{
16+
"#<?= /* @escapeNotVerified */ $block->getRenameFormId() ?>": {
17+
"Magento_Tax/js/page/validate": {}
18+
}
19+
}
2020
</script>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* Copyright © Magento, Inc. All rights reserved.
3+
* See COPYING.txt for license details.
4+
*/
5+
6+
define([
7+
'jquery',
8+
'mage/mage'
9+
], function (jQuery) {
10+
'use strict';
11+
12+
return function (data, element) {
13+
jQuery(element).mage('form').mage('validation');
14+
};
15+
});

0 commit comments

Comments
 (0)