Skip to content

Commit c54fc09

Browse files
author
Stanislav Idolov
authored
ENGCOM-2068: Refactor validate code in Tax module #16270
2 parents 047d330 + 75fab2e commit c54fc09

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<?php echo $block->getSaveButtonHtml(); ?>
1212
</div>
1313
<?php echo $block->getRenameFormHtml(); ?>
14-
<script>
15-
require(['jquery', "mage/mage"], function(jQuery){
16-
17-
jQuery('#<?php /* @escapeNotVerified */ echo $block->getRenameFormId() ?>').mage('form').mage('validation');
18-
19-
});
20-
</script>
14+
<script type="text/x-magento-init">
15+
{
16+
"#<?= /* @escapeNotVerified */ $block->getRenameFormId() ?>": {
17+
"Magento_Tax/js/page/validate": {}
18+
}
19+
}
20+
</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)