File tree Expand file tree Collapse file tree 3 files changed +46
-2
lines changed
app/code/Magento/Customer/view/frontend Expand file tree Collapse file tree 3 files changed +46
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,8 @@ var config = {
10
10
address : 'Magento_Customer/address' ,
11
11
changeEmailPassword : 'Magento_Customer/change-email-password' ,
12
12
passwordStrengthIndicator : 'Magento_Customer/js/password-strength-indicator' ,
13
- zxcvbn : 'Magento_Customer/js/zxcvbn'
13
+ zxcvbn : 'Magento_Customer/js/zxcvbn' ,
14
+ addressValidation : 'Magento_Customer/js/addressValidation'
14
15
}
15
16
}
16
17
} ;
Original file line number Diff line number Diff line change 203
203
<script type="text/x-magento-init">
204
204
{
205
205
"#form-validate": {
206
- "validation ": {}
206
+ "addressValidation ": {}
207
207
},
208
208
"#country": {
209
209
"regionUpdater": {
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Copyright © 2016 Magento. All rights reserved.
3
+ * See COPYING.txt for license details.
4
+ */
5
+ /*jshint browser:true jquery:true*/
6
+ define ( [
7
+ 'jquery' ,
8
+ 'jquery/ui' ,
9
+ 'validation'
10
+ ] , function ( $ ) {
11
+ 'use strict' ;
12
+
13
+ $ . widget ( 'mage.addressValidation' , {
14
+ options : {
15
+ selectors : {
16
+ button : '[data-action=save-address]'
17
+ }
18
+ } ,
19
+
20
+ /**
21
+ * Validation creation
22
+ * @protected
23
+ */
24
+ _create : function ( ) {
25
+ var button = $ ( this . options . selectors . button , this . element ) ;
26
+
27
+ this . element . validation ( {
28
+
29
+ /**
30
+ * Submit Handler
31
+ * @param {Element } form - address form
32
+ */
33
+ submitHandler : function ( form ) {
34
+
35
+ button . attr ( 'disabled' , true ) ;
36
+ form . submit ( ) ;
37
+ }
38
+ } ) ;
39
+ }
40
+ } ) ;
41
+
42
+ return $ . mage . addressValidation ;
43
+ } ) ;
You can’t perform that action at this time.
0 commit comments