File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -105,20 +105,17 @@ jQuery(function ($) {
105105 /**
106106 * disable-with handlers
107107 */
108- var disable_with_input_selector = 'input[data-disable-with]' ;
109- var disable_with_form_selector = 'form[data-remote]:has(' + disable_with_input_selector + ')' ;
110-
111- $ ( disable_with_form_selector ) . live ( 'ajax:before' , function ( ) {
112- $ ( this ) . find ( disable_with_input_selector ) . each ( function ( ) {
108+ $ ( 'form[data-remote]' ) . live ( 'ajax:before' , function ( ) {
109+ $ ( this ) . find ( 'input[data-disable-with]' ) . each ( function ( ) {
113110 var input = $ ( this ) ;
114111 input . data ( 'enable-with' , input . val ( ) )
115112 . attr ( 'value' , input . attr ( 'data-disable-with' ) )
116113 . attr ( 'disabled' , 'disabled' ) ;
117114 } ) ;
118115 } ) ;
119116
120- $ ( disable_with_form_selector ) . live ( 'ajax:after ' , function ( ) {
121- $ ( this ) . find ( disable_with_input_selector ) . each ( function ( ) {
117+ $ ( 'form[data-remote]' ) . live ( 'ajax:complete ' , function ( ) {
118+ $ ( this ) . find ( 'input[data-disable-with]' ) . each ( function ( ) {
122119 var input = $ ( this ) ;
123120 input . removeAttr ( 'disabled' )
124121 . val ( input . data ( 'enable-with' ) ) ;
You can’t perform that action at this time.
0 commit comments