Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: Move form method into its own module
Ref #9647
- Loading branch information
Showing
4 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
( function( factory ) { | ||
if ( typeof define === "function" && define.amd ) { | ||
|
||
// AMD. Register as an anonymous module. | ||
define( [ "jquery", "./version" ], factory ); | ||
} else { | ||
|
||
// Browser globals | ||
factory( jQuery ); | ||
} | ||
} ( function( $ ) { | ||
|
||
// Support: IE8 Only | ||
// IE8 does not support the form attribute and when it is supplied. It overwrites the form prop | ||
// with a string, so we need to find the proper form. | ||
return $.fn.form = function() { | ||
return typeof this[ 0 ].form === "string" ? this.closest( "form" ) : $( this[ 0 ].form ); | ||
}; | ||
|
||
} ) ); |