File tree Expand file tree Collapse file tree 3 files changed +43
-40
lines changed
app/code/Magento/Customer/view/frontend/templates Expand file tree Collapse file tree 3 files changed +43
-40
lines changed Original file line number Diff line number Diff line change 99
99
<a class="action back" href="<?php echo $ block ->escapeUrl ($ block ->getBackUrl ()) ?> "><span><?php echo __ ('Back ' ) ?> </span></a>
100
100
</div>
101
101
</div>
102
-
103
- <script>
104
- require(['jquery', "mage/mage"], function(jQuery){
105
-
106
- jQuery('.page-main').mage('address', {
107
- deleteAddress: "li.item a[role='delete-address']",
108
- deleteUrlPrefix: '<?php echo $ block ->getDeleteUrl () ?> id/',
109
- addAddress: "button[role='add-address']",
110
- addAddressLocation: '<?php echo $ block ->getAddAddressUrl () ?> '
111
- });
112
-
113
- });
102
+ <script type="text/x-magento-init">
103
+ {
104
+ ".page-main": {
105
+ "address": {
106
+ "deleteAddress": "li.item a[role='delete-address']",
107
+ "deleteUrlPrefix": "<?php echo $ block ->getDeleteUrl () ?> id/",
108
+ "addAddress": "button[role='add-address']",
109
+ "addAddressLocation": "<?php echo $ block ->getAddAddressUrl () ?> "
110
+ }
111
+ }
112
+ }
114
113
</script>
Original file line number Diff line number Diff line change 132
132
</div>
133
133
</div>
134
134
</form>
135
- <script>
136
- require([
137
- "jquery",
138
- "mage/validation",
139
- "Magento_Checkout/js/region-updater"
140
- ], function($){
141
- var $form = $('#form-validate');
142
- $form.validation();
143
- $('#country').regionUpdater({
144
- optionalRegionAllowed: <?php echo ($ block ->getConfig ('general/region/display_all ' ) ? 'true ' : 'false ' ); ?> ,
145
- regionListId: '#region_id',
146
- regionInputId: '#region',
147
- postcodeId: '#zip',
148
- form: $form,
149
- regionJson: <?php echo $ this ->helper ('Magento\Directory\Helper\Data ' )->getRegionJson () ?> ,
150
- defaultRegion: "<?php echo $ block ->getRegionId () ?> ",
151
- countriesWithOptionalZip: <?php echo $ this ->helper ('Magento\Directory\Helper\Data ' )->getCountriesWithOptionalZip (true ) ?>
152
- });
153
- });
135
+ <script type="text/x-magento-init">
136
+ {
137
+ "#form-validate": {
138
+ "validation": {}
139
+ },
140
+ "#country": {
141
+ "regionUpdater": {
142
+ "optionalRegionAllowed": <?php echo ($ block ->getConfig ('general/region/display_all ' ) ? 'true ' : 'false ' ); ?> ,
143
+ "regionListId": "#region_id",
144
+ "regionInputId": "#region",
145
+ "postcodeId": "#zip",
146
+ "form": "#form-validate",
147
+ "regionJson": <?php echo $ this ->helper ('Magento\Directory\Helper\Data ' )->getRegionJson () ?> ,
148
+ "defaultRegion": "<?php echo $ block ->getRegionId () ?> ",
149
+ "countriesWithOptionalZip": <?php echo $ this ->helper ('Magento\Directory\Helper\Data ' )->getCountriesWithOptionalZip (true ) ?>
150
+ }
151
+ }
152
+ }
154
153
</script>
Original file line number Diff line number Diff line change 72
72
"jquery",
73
73
"mage/mage"
74
74
], function($){
75
-
76
- $('#change-password').mage('setPassword', {
77
- 'currentPasswordId': '#current-password',
78
- 'passwordId': '#password',
79
- 'confirmationId': '#password-confirmation',
80
- 'passwordContainer': 'fieldset.fieldset.password',
81
- 'showOnDefault': <?php echo $ block ->getChangePassword () ? 'true ' : 'false ' ?>
82
- });
83
-
84
75
var dataForm = $('#form-validate');
85
76
var ignore = <?php echo $ _dob ->isEnabled () ? '\'input[id$="full"] \'' : 'null ' ; ?> ;
77
+
86
78
dataForm.mage('validation', {
87
79
<?php if ($ _dob ->isEnabled ()): ?>
88
80
errorPlacement: function(error, element) {
105
97
106
98
});
107
99
</script>
100
+ <script type="text/x-magento-init">
101
+ {
102
+ "#change-password": {
103
+ "setPassword": {
104
+ "currentPasswordId": "#current-password",
105
+ "passwordId": "#password",
106
+ "confirmationId": "#password-confirmation",
107
+ "passwordContainer": "fieldset.fieldset.password",
108
+ "showOnDefault": <?php echo $ block ->getChangePassword () ? 'true ' : 'false ' ?>
109
+ }
110
+ }
111
+ }
112
+ </script>
You can’t perform that action at this time.
0 commit comments