]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - vendor/oojs/oojs-ui/php/layouts/HorizontalLayout.php
MediaWiki 1.30.2
[autoinstallsdev/mediawiki.git] / vendor / oojs / oojs-ui / php / layouts / HorizontalLayout.php
diff --git a/vendor/oojs/oojs-ui/php/layouts/HorizontalLayout.php b/vendor/oojs/oojs-ui/php/layouts/HorizontalLayout.php
new file mode 100644 (file)
index 0000000..c2a1805
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace OOUI;
+
+/**
+ * HorizontalLayout arranges its contents in a single line (using `display: inline-block` for its
+ * items), with small margins between them.
+ */
+class HorizontalLayout extends Layout {
+       use GroupElement;
+
+       /**
+        * @param array $config Configuration options
+        * @param Widget[]|Layout[] $config['items'] Widgets or other layouts to add to the layout.
+        */
+       public function __construct( array $config = [] ) {
+               // Parent constructor
+               parent::__construct( $config );
+
+               // Traits
+               $this->initializeGroupElement( array_merge( $config, [ 'group' => $this ] ) );
+
+               // Initialization
+               $this->addClasses( [ 'oo-ui-horizontalLayout' ] );
+               if ( isset( $config['items'] ) ) {
+                       $this->addItems( $config['items'] );
+               }
+       }
+}