Florianschmidtwelzow has uploaded a new change for review.
https://gerrit.wikimedia.org/r/231395
Change subject: Don't add a margin if no line break is added between input and
button
......................................................................
Don't add a margin if no line break is added between input and button
If there is no line break between the button and the input field (both
fields are in the same line), don't add a margin-bottom[1] to the inputfield.
[1] Originally added to make some space between the button and the input field,
which doesn't make sense, if both are in the same line. Added in:
Follow up: I6435df752530
Bug: T108512
Change-Id: I51f3ede288a220a54937a7b79dc9366e0a031db8
---
M InputBox.classes.php
1 file changed, 14 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/InputBox
refs/changes/95/231395/1
diff --git a/InputBox.classes.php b/InputBox.classes.php
index 5ce2590..36c7425 100644
--- a/InputBox.classes.php
+++ b/InputBox.classes.php
@@ -84,6 +84,16 @@
}
/**
+ * Get common classes, that could be added and depend on, if
+ * a line break between a button and an input field is added or not.
+ *
+ * @return String
+ */
+ private function getLinebreakClasses() {
+ return strtolower( $this->mBR ) === '<br />' ?
'mw-inputbox-input ' : '';
+ }
+
+ /**
* Generate search form
* @param $type
* @return string HTML
@@ -123,7 +133,7 @@
);
$htmlOut .= Xml::element( 'input',
array(
- 'class' => 'mw-inputbox-input searchboxInput
mw-ui-input mw-ui-input-inline',
+ 'class' => $this->getLinebreakClasses() .
'searchboxInput mw-ui-input mw-ui-input-inline',
'name' => 'search',
'type' => $this->mHidden ? 'hidden' : 'text',
'value' => $this->mDefaultText,
@@ -371,7 +381,7 @@
array(
'type' => $this->mHidden ? 'hidden' : 'text',
'name' => 'title',
- 'class' => ( strtolower( $this->mBR ) === '<br
/>' ? 'mw-inputbox-input ' : '' ) .
+ 'class' => $this->getLinebreakClasses() .
'mw-ui-input mw-ui-input-inline
createboxInput',
'value' => $this->mDefaultText,
'placeholder' => $this->mPlaceholderText,
@@ -428,7 +438,7 @@
array(
'type' => $this->mHidden ? 'hidden' : 'text',
'name' => 'wpNewTitle',
- 'class' => 'mw-inputbox-input mw-moveboxInput
mw-ui-input mw-ui-input-inline',
+ 'class' => $this->getLinebreakClasses() .
'mw-moveboxInput mw-ui-input mw-ui-input-inline',
'value' => $this->mDefaultText,
'placeholder' => $this->mPlaceholderText,
'size' => $this->mWidth,
@@ -486,7 +496,7 @@
array(
'type' => $this->mHidden ? 'hidden' : 'text',
'name' => 'preloadtitle',
- 'class' => 'mw-inputbox-input commentboxInput
mw-ui-input mw-ui-input-inline',
+ 'class' => $this->getLinebreakClasses() .
'commentboxInput mw-ui-input mw-ui-input-inline',
'value' => $this->mDefaultText,
'placeholder' => $this->mPlaceholderText,
'size' => $this->mWidth,
--
To view, visit https://gerrit.wikimedia.org/r/231395
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I51f3ede288a220a54937a7b79dc9366e0a031db8
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/InputBox
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits