aboutsummaryrefslogtreecommitdiffstats
path: root/ui/form.js
diff options
context:
space:
mode:
authorAlexander Schmitz <arschmitz@gmail.com>2015-07-16 09:14:58 -0400
committerAlexander Schmitz <arschmitz@gmail.com>2015-08-08 00:29:36 -0400
commit64076ecfb5870130d89733ff34668fdd18683f9b (patch)
tree57ee9671983872f4cd92011c7d6b0c1128906a25 /ui/form.js
parent47188b792617a0030ccec07c6df27335dc3aa430 (diff)
downloadjquery-ui-64076ecfb5870130d89733ff34668fdd18683f9b.tar.gz
jquery-ui-64076ecfb5870130d89733ff34668fdd18683f9b.zip
Core: Move form method into its own module
Ref #9647
Diffstat (limited to 'ui/form.js')
-rw-r--r--ui/form.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/ui/form.js b/ui/form.js
new file mode 100644
index 000000000..cfb4bd280
--- /dev/null
+++ b/ui/form.js
@@ -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 );
+};
+
+} ) );