File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 6
6
import $ from "jquery" ;
7
7
import ajax from "../ajax/ajax" ;
8
8
import Base from "../../core/base" ;
9
+ import events from "../../core/events" ;
9
10
import inject from "../inject/inject" ;
10
11
import logging from "../../core/logging" ;
11
12
@@ -16,7 +17,12 @@ export default Base.extend({
16
17
trigger : ".pat-subform" ,
17
18
18
19
init ( $el ) {
19
- $el . submit ( this . submit . bind ( this ) ) ;
20
+ events . add_event_listener (
21
+ $el [ 0 ] ,
22
+ "submit" ,
23
+ "pat-subform--submit" ,
24
+ this . submit . bind ( this )
25
+ ) ;
20
26
$el . find ( "input" ) . on ( "keyup keypress keydown" , this . keyboard_handler . bind ( this ) ) ;
21
27
$el . find ( "button[type=submit]" ) . on ( "click" , this . submitClicked . bind ( this ) ) ;
22
28
} ,
@@ -76,7 +82,7 @@ export default Base.extend({
76
82
if ( ! $subform . is ( ".pat-autosubmit" ) ) {
77
83
return ;
78
84
}
79
- return $subform . submit ( ) ;
85
+ $subform [ 0 ] . dispatchEvent ( events . submit_event ( ) ) ;
80
86
} ,
81
87
82
88
submitClicked ( ev ) {
You can’t perform that action at this time.
0 commit comments