File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 178178 /* Disables form elements:
179179 - Caches element value in 'ujs:enable-with' data store
180180 - Replaces element text with value of 'data-disable-with' attribute
181- - Adds disabled=disabled attribute
181+ - Sets disabled property to true
182182 */
183183 disableFormElements : function ( form ) {
184184 form . find ( rails . disableSelector ) . each ( function ( ) {
185185 var element = $ ( this ) , method = element . is ( 'button' ) ? 'html' : 'val' ;
186186 element . data ( 'ujs:enable-with' , element [ method ] ( ) ) ;
187187 element [ method ] ( element . data ( 'disable-with' ) ) ;
188- element . attr ( 'disabled' , 'disabled' ) ;
188+ element . prop ( 'disabled' , true ) ;
189189 } ) ;
190190 } ,
191191
192192 /* Re-enables disabled form elements:
193193 - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
194- - Removes disabled attribute
194+ - Sets disabled property to false
195195 */
196196 enableFormElements : function ( form ) {
197197 form . find ( rails . enableSelector ) . each ( function ( ) {
198198 var element = $ ( this ) , method = element . is ( 'button' ) ? 'html' : 'val' ;
199199 if ( element . data ( 'ujs:enable-with' ) ) element [ method ] ( element . data ( 'ujs:enable-with' ) ) ;
200- element . removeAttr ( 'disabled' ) ;
200+ element . prop ( 'disabled' , false ) ;
201201 } ) ;
202202 } ,
203203
You can’t perform that action at this time.
0 commit comments