Merge "Add tablesUsed to RevisionStoreDbTest"
[lhc/web/wiklou.git] / resources / src / mediawiki / htmlform / htmlform.Element.js
1 ( function ( mw ) {
2
3 mw.htmlform = {};
4
5 /**
6 * Allows custom data specific to HTMLFormField to be set for OOUI forms. This picks up the
7 * extra config from a matching PHP widget (defined in HTMLFormElement.php) when constructed using
8 * OO.ui.infuse().
9 *
10 * Currently only supports passing 'hide-if' data.
11 *
12 * @ignore
13 * @param {Object} [config] Configuration options
14 */
15 mw.htmlform.Element = function ( config ) {
16 // Configuration initialization
17 config = config || {};
18
19 // Properties
20 this.hideIf = config.hideIf;
21
22 // Initialization
23 if ( this.hideIf ) {
24 this.$element.addClass( 'mw-htmlform-hide-if' );
25 }
26 };
27
28 mw.htmlform.FieldLayout = function ( config ) {
29 // Parent constructor
30 mw.htmlform.FieldLayout.parent.call( this, config );
31 // Mixin constructors
32 mw.htmlform.Element.call( this, config );
33 };
34 OO.inheritClass( mw.htmlform.FieldLayout, OO.ui.FieldLayout );
35 OO.mixinClass( mw.htmlform.FieldLayout, mw.htmlform.Element );
36
37 mw.htmlform.ActionFieldLayout = function ( config ) {
38 // Parent constructor
39 mw.htmlform.ActionFieldLayout.parent.call( this, config );
40 // Mixin constructors
41 mw.htmlform.Element.call( this, config );
42 };
43 OO.inheritClass( mw.htmlform.ActionFieldLayout, OO.ui.ActionFieldLayout );
44 OO.mixinClass( mw.htmlform.ActionFieldLayout, mw.htmlform.Element );
45
46 }( mediaWiki ) );