Merge "resources: Strip '$' and 'mw' from file closures"
[lhc/web/wiklou.git] / resources / src / mediawiki.htmlform / htmlform.js
1 ( function () {
2
3 $( function () {
4 mw.hook( 'htmlform.enhance' ).fire( $( document ) );
5 } );
6
7 mw.hook( 'htmlform.enhance' ).add( function ( $root ) {
8 // Turn HTML5 form validation back on, in cases where it was disabled server-side (see
9 // HTMLForm::needsJSForHtml5FormValidation()) because we need extra logic implemented in JS to
10 // validate correctly. Currently, this is only used for forms containing fields with 'hide-if'.
11 $root.find( '.mw-htmlform' ).removeAttr( 'novalidate' );
12 } );
13
14 }() );