Bartosz Dziewoński has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/215738

Change subject: ActionFieldLayout: Dead code removal and cleanup
......................................................................

ActionFieldLayout: Dead code removal and cleanup

* Remove documentation comments duplicated from FieldLayout.
* Remove properties duplicated from FieldLayout.
* Split off 'Initialization' section from 'Properties'.
* Add .oo-ui-actionFieldLayout class to this.$element, not this.$field.
* Remove styles for .oo-ui-actionFieldLayout-field which never existed.

Change-Id: I2bc2efa9272cb389d92cf3691057e4c2e3e089c8
---
M demos/pages/widgets.js
M src/layouts/ActionFieldLayout.js
M src/styles/layouts/ActionFieldLayout.less
3 files changed, 14 insertions(+), 23 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/38/215738/1

diff --git a/demos/pages/widgets.js b/demos/pages/widgets.js
index 9f18652..2030dbe 100644
--- a/demos/pages/widgets.js
+++ b/demos/pages/widgets.js
@@ -1308,7 +1308,7 @@
                                        }
                                ),
                                new OO.ui.ActionFieldLayout(
-                                       new OO.ui.TextInputWidget( {} ),
+                                       new OO.ui.TextInputWidget(),
                                        new OO.ui.ButtonWidget( {
                                                label: 'Button'
                                        } ),
@@ -1318,7 +1318,7 @@
                                        }
                                ),
                                new OO.ui.ActionFieldLayout(
-                                       new OO.ui.TextInputWidget( {} ),
+                                       new OO.ui.TextInputWidget(),
                                        new OO.ui.ButtonWidget( {
                                                label: 'Button'
                                        } ),
@@ -1328,7 +1328,7 @@
                                        }
                                ),
                                new OO.ui.ActionFieldLayout(
-                                       new OO.ui.TextInputWidget( {} ),
+                                       new OO.ui.TextInputWidget(),
                                        new OO.ui.ButtonWidget( {
                                                label: 'Button'
                                        } ),
@@ -1338,7 +1338,7 @@
                                        }
                                ),
                                new OO.ui.ActionFieldLayout(
-                                       new OO.ui.TextInputWidget( {} ),
+                                       new OO.ui.TextInputWidget(),
                                        new OO.ui.ButtonWidget( {
                                                label: 'Button'
                                        } ),
@@ -1348,7 +1348,7 @@
                                        }
                                ),
                                new OO.ui.ActionFieldLayout(
-                                       new OO.ui.TextInputWidget( {} ),
+                                       new OO.ui.TextInputWidget(),
                                        new OO.ui.ButtonWidget( {
                                                label: 'Button'
                                        } ),
@@ -1360,7 +1360,7 @@
                                        }
                                ),
                                new OO.ui.ActionFieldLayout(
-                                       new OO.ui.TextInputWidget( {} ),
+                                       new OO.ui.TextInputWidget(),
                                        new OO.ui.ButtonWidget( {
                                                label: 'Button'
                                        } ),
diff --git a/src/layouts/ActionFieldLayout.js b/src/layouts/ActionFieldLayout.js
index 59640ed..91eb912 100644
--- a/src/layouts/ActionFieldLayout.js
+++ b/src/layouts/ActionFieldLayout.js
@@ -43,10 +43,6 @@
  * @constructor
  * @param {OO.ui.Widget} fieldWidget Field widget
  * @param {OO.ui.ButtonWidget} buttonWidget Button widget
- * @param {Object} [config] Configuration options
- * @cfg {string} [align='left'] Alignment of the label: 'left', 'right', 'top' 
or 'inline'
- * @cfg {string} [help] Help text. When help text is specified, a help icon 
will appear in the
- *  upper-right corner of the rendered field.
  */
 OO.ui.ActionFieldLayout = function OoUiActionFieldLayout( fieldWidget, 
buttonWidget, config ) {
        // Allow passing positional parameters inside the config object
@@ -56,23 +52,24 @@
                buttonWidget = config.buttonWidget;
        }
 
-       // Configuration initialization
-       config = $.extend( { align: 'left' }, config );
-
        // Parent constructor
        OO.ui.ActionFieldLayout.super.call( this, fieldWidget, config );
 
        // Properties
-       this.fieldWidget = fieldWidget;
        this.buttonWidget = buttonWidget;
-       this.$button = $( '<div>' )
+       this.$button = $( '<div>' );
+       this.$input = $( '<div>' );
+
+       // Initialization
+       this.$element
+               .addClass( 'oo-ui-actionFieldLayout' );
+       this.$button
                .addClass( 'oo-ui-actionFieldLayout-button' )
                .append( this.buttonWidget.$element );
-       this.$input = $( '<div>' )
+       this.$input
                .addClass( 'oo-ui-actionFieldLayout-input' )
                .append( this.fieldWidget.$element );
        this.$field
-               .addClass( 'oo-ui-actionFieldLayout' )
                .append( this.$input, this.$button );
 };
 
diff --git a/src/styles/layouts/ActionFieldLayout.less 
b/src/styles/layouts/ActionFieldLayout.less
index 2d4c2a6..9cce2f8 100644
--- a/src/styles/layouts/ActionFieldLayout.less
+++ b/src/styles/layouts/ActionFieldLayout.less
@@ -1,12 +1,6 @@
 @import '../common';
 
 .oo-ui-actionFieldLayout {
-       &-field {
-               display: table;
-               table-layout: fixed;
-               width: 100%;
-       }
-
        &-input,
        &-button {
                display: table-cell;

-- 
To view, visit https://gerrit.wikimedia.org/r/215738
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2bc2efa9272cb389d92cf3691057e4c2e3e089c8
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <matma....@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to