mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-17 09:52:29 +01:00
fixes #5150: add btn-group support to input groups
This commit is contained in:
parent
443c43f6c4
commit
532ee08213
23
docs/assets/css/bootstrap.css
vendored
23
docs/assets/css/bootstrap.css
vendored
@ -1648,8 +1648,17 @@ select:focus:required:invalid:focus {
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
.input-append input + .btn-group .btn,
|
||||
.input-append select + .btn-group .btn,
|
||||
.input-append .uneditable-input + .btn-group .btn {
|
||||
-webkit-border-radius: 0 4px 4px 0;
|
||||
-moz-border-radius: 0 4px 4px 0;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.input-append .add-on,
|
||||
.input-append .btn {
|
||||
.input-append .btn,
|
||||
.input-append .btn-group {
|
||||
margin-left: -1px;
|
||||
}
|
||||
|
||||
@ -1668,6 +1677,14 @@ select:focus:required:invalid:focus {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.input-prepend.input-append input + .btn-group .btn,
|
||||
.input-prepend.input-append select + .btn-group .btn,
|
||||
.input-prepend.input-append .uneditable-input + .btn-group .btn {
|
||||
-webkit-border-radius: 0 4px 4px 0;
|
||||
-moz-border-radius: 0 4px 4px 0;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.input-prepend.input-append .add-on:first-child,
|
||||
.input-prepend.input-append .btn:first-child {
|
||||
margin-right: -1px;
|
||||
@ -1684,6 +1701,10 @@ select:focus:required:invalid:focus {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.input-prepend.input-append .btn-group:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
input.search-query {
|
||||
padding-right: 14px;
|
||||
padding-right: 4px \9;
|
||||
|
@ -1131,20 +1131,22 @@ For example, <code><section></code> should be wrapped as inlin
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">@</span>
|
||||
<input class="span2" id="prependedInput" size="16" type="text" placeholder="Username">
|
||||
<input class="span2" id="prependedInput" type="text" placeholder="Username">
|
||||
</div>
|
||||
<br>
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInput" size="16" type="text">
|
||||
<input class="span2" id="appendedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">@</span><input class="span2" id="prependedInput" size="16" type="text" placeholder="Username">
|
||||
<span class="add-on">@</span>
|
||||
<input class="span2" id="prependedInput" type="text" placeholder="Username">
|
||||
</div>
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInput" size="16" type="text"><span class="add-on">.00</span>
|
||||
<input class="span2" id="appendedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
@ -1153,13 +1155,15 @@ For example, <code><section></code> should be wrapped as inlin
|
||||
<form class="bs-docs-example form-inline">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">$</span>
|
||||
<input class="span2" id="appendedPrependedInput" size="16" type="text">
|
||||
<input class="span2" id="appendedPrependedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">$</span><input class="span2" id="appendedPrependedInput" size="16" type="text"><span class="add-on">.00</span>
|
||||
<span class="add-on">$</span>
|
||||
<input class="span2" id="appendedPrependedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
@ -1167,23 +1171,139 @@ For example, <code><section></code> should be wrapped as inlin
|
||||
<p>Instead of a <code><span></code> with text, use a <code>.btn</code> to attach a button (or two) to an input.</p>
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButton" size="16" type="text">
|
||||
<input class="span2" id="appendedInputButton" type="text">
|
||||
<button class="btn" type="button">Go!</button>
|
||||
</div>
|
||||
<br>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButton" type="text">
|
||||
<button class="btn" type="button">Go!</button>
|
||||
</div>
|
||||
</pre>
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButtons" size="16" type="text">
|
||||
<input class="span2" id="appendedInputButtons" type="text">
|
||||
<button class="btn" type="button">Search</button>
|
||||
<button class="btn" type="button">Options</button>
|
||||
</div>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButton" size="16" type="text"><button class="btn" type="button">Go!</button>
|
||||
<input class="span2" id="appendedInputButtons" type="text">
|
||||
<button class="btn" type="button">Search</button>
|
||||
<button class="btn" type="button">Options</button>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
<h4>Button dropdowns</h4>
|
||||
<p></p>
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-append -->
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButtons" size="16" type="text"><button class="btn" type="button">Search</button><button class="btn" type="button">Options</button>
|
||||
<input class="span2" id="appendedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
Action
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-prepend">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<input class="span2" id="prependedDropdownButton" type="text">
|
||||
</div><!-- /input-prepend -->
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
Action
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
<input class="span2" id="prependedDropdownButton" type="text">
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-prepend input-append">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<input class="span2" id="appendedPrependedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">Action <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">Action</a></li>
|
||||
<li><a href="#">Another action</a></li>
|
||||
<li><a href="#">Something else here</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">Separated link</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-prepend input-append -->
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend input-append">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
Action
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
<input class="span2" id="appendedPrependedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
Action
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
|
142
docs/templates/pages/base-css.mustache
vendored
142
docs/templates/pages/base-css.mustache
vendored
@ -1068,20 +1068,22 @@
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">@</span>
|
||||
<input class="span2" id="prependedInput" size="16" type="text" placeholder="{{_i}}Username{{/i}}">
|
||||
<input class="span2" id="prependedInput" type="text" placeholder="{{_i}}Username{{/i}}">
|
||||
</div>
|
||||
<br>
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInput" size="16" type="text">
|
||||
<input class="span2" id="appendedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend">
|
||||
<span class="add-on">@</span><input class="span2" id="prependedInput" size="16" type="text" placeholder="{{_i}}Username{{/i}}">
|
||||
<span class="add-on">@</span>
|
||||
<input class="span2" id="prependedInput" type="text" placeholder="{{_i}}Username{{/i}}">
|
||||
</div>
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInput" size="16" type="text"><span class="add-on">.00</span>
|
||||
<input class="span2" id="appendedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
@ -1090,13 +1092,15 @@
|
||||
<form class="bs-docs-example form-inline">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">$</span>
|
||||
<input class="span2" id="appendedPrependedInput" size="16" type="text">
|
||||
<input class="span2" id="appendedPrependedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend input-append">
|
||||
<span class="add-on">$</span><input class="span2" id="appendedPrependedInput" size="16" type="text"><span class="add-on">.00</span>
|
||||
<span class="add-on">$</span>
|
||||
<input class="span2" id="appendedPrependedInput" type="text">
|
||||
<span class="add-on">.00</span>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
@ -1104,23 +1108,139 @@
|
||||
<p>{{_i}}Instead of a <code><span></code> with text, use a <code>.btn</code> to attach a button (or two) to an input.{{/i}}</p>
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButton" size="16" type="text">
|
||||
<input class="span2" id="appendedInputButton" type="text">
|
||||
<button class="btn" type="button">Go!</button>
|
||||
</div>
|
||||
<br>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButton" type="text">
|
||||
<button class="btn" type="button">Go!</button>
|
||||
</div>
|
||||
</pre>
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButtons" size="16" type="text">
|
||||
<input class="span2" id="appendedInputButtons" type="text">
|
||||
<button class="btn" type="button">Search</button>
|
||||
<button class="btn" type="button">Options</button>
|
||||
</div>
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButton" size="16" type="text"><button class="btn" type="button">Go!</button>
|
||||
<input class="span2" id="appendedInputButtons" type="text">
|
||||
<button class="btn" type="button">Search</button>
|
||||
<button class="btn" type="button">Options</button>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
<h4>{{_i}}Button dropdowns{{/i}}</h4>
|
||||
<p>{{_i}}{{/i}}</p>
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">{{_i}}Action{{/i}} <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">{{_i}}Action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Another action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Something else here{{/i}}</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">{{_i}}Separated link{{/i}}</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-append -->
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-append">
|
||||
<input class="span2" id="appendedInputButtons" size="16" type="text"><button class="btn" type="button">Search</button><button class="btn" type="button">Options</button>
|
||||
<input class="span2" id="appendedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
{{_i}}Action{{/i}}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-prepend">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">{{_i}}Action{{/i}} <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">{{_i}}Action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Another action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Something else here{{/i}}</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">{{_i}}Separated link{{/i}}</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<input class="span2" id="prependedDropdownButton" type="text">
|
||||
</div><!-- /input-prepend -->
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
{{_i}}Action{{/i}}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
<input class="span2" id="prependedDropdownButton" type="text">
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
<form class="bs-docs-example">
|
||||
<div class="input-prepend input-append">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">{{_i}}Action{{/i}} <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">{{_i}}Action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Another action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Something else here{{/i}}</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">{{_i}}Separated link{{/i}}</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
<input class="span2" id="appendedPrependedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">{{_i}}Action{{/i}} <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">{{_i}}Action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Another action{{/i}}</a></li>
|
||||
<li><a href="#">{{_i}}Something else here{{/i}}</a></li>
|
||||
<li class="divider"></li>
|
||||
<li><a href="#">{{_i}}Separated link{{/i}}</a></li>
|
||||
</ul>
|
||||
</div><!-- /btn-group -->
|
||||
</div><!-- /input-prepend input-append -->
|
||||
</form>
|
||||
<pre class="prettyprint linenums">
|
||||
<div class="input-prepend input-append">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
{{_i}}Action{{/i}}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
<input class="span2" id="appendedPrependedDropdownButton" type="text">
|
||||
<div class="btn-group">
|
||||
<button class="btn dropdown-toggle" data-toggle="dropdown">
|
||||
{{_i}}Action{{/i}}
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
...
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</pre>
|
||||
|
||||
|
@ -466,6 +466,7 @@ select:focus:required:invalid {
|
||||
border-color: @green;
|
||||
}
|
||||
}
|
||||
|
||||
.input-prepend {
|
||||
.add-on,
|
||||
.btn {
|
||||
@ -473,17 +474,23 @@ select:focus:required:invalid {
|
||||
}
|
||||
.add-on:first-child,
|
||||
.btn:first-child {
|
||||
// FYI, `.btn:first-child` accounts for a button group that's prepended
|
||||
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
|
||||
}
|
||||
}
|
||||
|
||||
.input-append {
|
||||
input,
|
||||
select,
|
||||
.uneditable-input {
|
||||
.border-radius(@inputBorderRadius 0 0 @inputBorderRadius);
|
||||
+ .btn-group .btn {
|
||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
||||
}
|
||||
}
|
||||
.add-on,
|
||||
.btn {
|
||||
.btn,
|
||||
.btn-group {
|
||||
margin-left: -1px;
|
||||
}
|
||||
.add-on:last-child,
|
||||
@ -491,12 +498,16 @@ select:focus:required:invalid {
|
||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove all border-radius for inputs with both prepend and append
|
||||
.input-prepend.input-append {
|
||||
input,
|
||||
select,
|
||||
.uneditable-input {
|
||||
.border-radius(0);
|
||||
+ .btn-group .btn {
|
||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
||||
}
|
||||
}
|
||||
.add-on:first-child,
|
||||
.btn:first-child {
|
||||
@ -508,10 +519,14 @@ select:focus:required:invalid {
|
||||
margin-left: -1px;
|
||||
.border-radius(0 @inputBorderRadius @inputBorderRadius 0);
|
||||
}
|
||||
.btn-group:first-child {
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// SEARCH FORM
|
||||
// -----------
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user