Commit 84f7368 1 parent a9b9c9d commit 84f7368 Copy full SHA for 84f7368
File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,10 @@ export class GeoWidgetPreview {
27
27
throw new Error ( 'BitBagInPostPlugin - The specified wrapper node could not be found in the DOM' ) ;
28
28
}
29
29
30
+ if ( ! data ) {
31
+ return ;
32
+ }
33
+
30
34
this . wrapper . innerHTML = '' ;
31
35
this . wrapper . insertAdjacentHTML (
32
36
'beforeend' ,
Original file line number Diff line number Diff line change @@ -2,9 +2,16 @@ import triggerCustomEvent from '../../common/js/utilities/triggerCustomEvent';
2
2
import { ValidateNextBtn } from './nextBtnValidation' ;
3
3
4
4
export class InpostPointEvents {
5
- constructor ( ) {
5
+ constructor ( config = { } ) {
6
6
const inputs = [ ...document . querySelectorAll ( '[value="inpost_point"]' ) ] ;
7
7
this . shippingGroups = inputs . map ( ( input ) => [ ...document . querySelectorAll ( `[name="${ input . name } "]` ) ] ) ;
8
+ this . defaultConfig = {
9
+ validateNextBtn : true ,
10
+ } ;
11
+ this . finalConfig = {
12
+ ...this . defaultConfig ,
13
+ ...config ,
14
+ } ;
8
15
}
9
16
10
17
init ( ) {
@@ -24,6 +31,11 @@ export class InpostPointEvents {
24
31
`inpost.point.${ field . value === 'inpost_point' ? 'selected' : 'deselected' } `
25
32
) ;
26
33
} ) ;
34
+
35
+ if ( ! validateNextBtn ) {
36
+ return ;
37
+ }
38
+
27
39
new ValidateNextBtn ( { node : field } ) . init ( ) ;
28
40
} ) ;
29
41
} ) ;
You can’t perform that action at this time.
0 commit comments