forked from gustavohenke/bselect
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
227 lines (217 loc) · 8.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html>
<head>
<title>bselect</title>
<meta charset="UTF-8" />
<meta name="description"
content="bselect - The select decorator component that was missing for Twitter Bootstrap 3." />
<link rel="stylesheet"
href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" />
<link rel="stylesheet" href="dist/css/bselect.min.css" />
<!--[if lte IE 8]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.6.2/html5shiv.js"></script>
<![endif]-->
</head>
<body>
<header class="jumbotron">
<div class="container">
<h1>bselect</h1>
<p class="lead">The select decorator component that was missing
for Twitter Bootstrap <em class="text-primary" style="font-size: ">3</em>.</p>
<iframe
src="//ghbtns.com/github-btn.html?user=derflocki&repo=bselect&type=watch&count=true"
style="width: 110px; height: 20px; border: 0"></iframe>
<iframe
src="//ghbtns.com/github-btn.html?user=derflocki&repo=bselect&type=fork&count=true"
style="width: 95px; height: 20px; border: 0"></iframe>
<iframe
src="//ghbtns.com/github-btn.html?user=derflocki&type=follow&count=true"
style="width: 165px; height: 20px; border: 0"></iframe>
</div>
</header>
<div data-keyboard="true" id="new-verhaletnis-modal" class="modal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
<h3>In a modal</h3>
</div>
<div class="modal-body">
<form id="create-verhaeltnis-form" class="form-horizontal" action="/~fdorn/accmanv4/web/index.php/berechtigungen/-143343" method="post" role="form">
<div class="col-lg-12">
<select id="bselect-modal" class="form-control">
<option value="">Select a band</option>
<option value="AC/DC">AC/DC</option>
<option value="Led Zeppelin">Led Zeppelin</option>
<option value="The Who">The Who</option>
<option value="Van Halen">Van Halen</option>
</select>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<div class="container">
<h2>Default functionality</h2>
<p>
The following functionality of bselect is default of the
<code><select></code>
s you already know. You don't need to do any extra markup or
configuration via JavaScript objects to have them working.
</p>
<h3>Standard select</h3>
<div class="row">
<div class="col-md-6">
<label for="select-standard">Turns this:</label>
<select
class="form-control languages col-lg-12" id="select-standard">
<option value="">Select an option</option>
<option value="Ada">Ada</option>
<option value="Assembly" disabled>Assembly</option>
<option value="C">C</option>
<option value="C#">C#</option>
<option value="C++">C++</option>
<option value="C++">CoffeeScript</option>
<option value="Dart">Dart</option>
<option value="Delphi">Delphi</option>
<option value="Erlang">Erlang</option>
<option value="F#">F#</option>
<option value="FORTRAN">FORTRAN</option>
<option value="Go">Go</option>
<option value="Haskell">Haskell</option>
<option value="Java">Java</option>
<option value="JavaScript">JavaScript</option>
<option value="Kotlin">Kotlin</option>
<option value="Lisp">Lisp</option>
<option value="Lua">Lua</option>
<option value="MATLAB">MATLAB</option>
<option value="Objective-C">Objective-C</option>
<option value="Pascal">Pascal</option>
<option value="Perl">Perl</option>
<option value="PHP">PHP</option>
<option value="Python">Python</option>
<option value="Ruby">Ruby</option>
<option value="Scala">Scala</option>
<option value="Shell">Shell</option>
<option value="Tcl">Tcl</option>
<option value="Visual Basic">Visual Basic</option>
</select>
</div>
<div class="col-md-6">
<label for="bselect-standard">Into this:</label>
<select class="form-control languages col-lg-12" id="bselect-standard">
<option value="">Select an option</option>
<option value="Ada">Ada</option>
<option value="Assembly" disabled>Assembly</option>
<option value="C">C</option>
<option value="C#">C#</option>
<option value="C++">C++</option>
<option value="C++">CoffeeScript</option>
<option value="Dart">Dart</option>
<option value="Delphi">Delphi</option>
<option value="Erlang">Erlang</option>
<option value="F#">F#</option>
<option value="FORTRAN">FORTRAN</option>
<option value="Go">Go</option>
<option value="Haskell">Haskell</option>
<option value="Java">Java</option>
<option value="JavaScript">JavaScript</option>
<option value="Kotlin">Kotlin</option>
<option value="Lisp">Lisp</option>
<option value="Lua">Lua</option>
<option value="MATLAB">MATLAB</option>
<option value="Objective-C">Objective-C</option>
<option value="Pascal">Pascal</option>
<option value="Perl">Perl</option>
<option value="PHP">PHP</option>
<option value="Python">Python</option>
<option value="Ruby">Ruby</option>
<option value="Scala">Scala</option>
<option value="Shell">Shell</option>
<option value="Tcl">Tcl</option>
<option value="Visual Basic">Visual Basic</option>
</select>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h3><optgroup> support</h3>
<select class="form-control col-lg-12" id="bselect-optgroup"
data-placeholder="Select a rock band">
<option value="">Select a rock band</option>
<option value="No">I don't like rock</option>
<optgroup label="Hard Rock">
<option value="AC/DC">AC/DC</option>
<option value="Led Zeppelin">Led Zeppelin</option>
<option value="The Who">The Who</option>
<option value="Van Halen">Van Halen</option>
</optgroup>
<optgroup label="Heavy Metal">
<option value="Black Sabbath">Black Sabbath</option>
<option value="Dio">Dio</option>
<option value="Iron Maiden">Iron Maiden</option>
<option value="Metallica">Metallica</option>
<option value="Motorhead">Motorhead</option>
</optgroup>
<optgroup label="Punk">
<option value="Sex Pistols">Sex Pistols</option>
<option value="The Clash">The Clash</option>
<option value="The Ramones">The Ramones</option>
<option value="Justin Bieber" disabled>Justin Bieber</option>
</optgroup>
</select>
</div>
<div class="col-md-6">
<h3>Disabled select</h3>
<select class="form-control col-lg-12" id="bselect-disabled"
data-placeholder="Select a rock band" disabled="disabled">
<option value="">Select a band</option>
<option value="AC/DC">AC/DC</option>
<option value="Led Zeppelin">Led Zeppelin</option>
<option value="The Who">The Who</option>
<option value="Van Halen">Van Halen</option>
</select>
</div>
</div>
<div class="row">
<div class="col-md-6 col-md-offset-3">
<h3>Inside hidden elements</h3>
<p>
When using it in a initially hidden element like a modal you have .resize() the parent before showing to properly size it
</p>
<pre>//resize the modal so bselect updates the width
$('.modal').on('show.bs.modal', function() {
setTimeout(function() {
$(this).trigger('resize');
});
});</pre>
<button data-target="#new-verhaletnis-modal" data-toggle="modal" class="btn btn-success btn-block" type="button">
<i class="glyphicon glyphicon-plus"></i> Open modal
</button>
</div>
</div>
</div>
<script
src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script
src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="dist/js/bselect.js"></script>
<script>
(function( $ ) {
"use strict";
$(document).ready(function() {
$("[id^='bselect-']").bselect();
});
$('.modal').on('show.bs.modal', function() {
setTimeout(function() {
$(this).trigger('resize');
});
});
})( jQuery );
</script>
</body>
</html>