0
0
mirror of https://github.com/twbs/bootstrap.git synced 2024-12-01 13:24:25 +01:00

Merge branch '2.0-wip' of github.com:twitter/bootstrap into 2.0-wip

Conflicts:
	docs/assets/css/bootstrap.css
	docs/download.html
This commit is contained in:
Mark Otto 2012-01-27 13:21:01 -08:00
commit ccd963e622
4 changed files with 19 additions and 6 deletions

View File

@ -6,7 +6,7 @@
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
* Date: Fri Jan 27 13:19:35 PST 2012
* Date: Fri Jan 27 13:20:51 PST 2012
*/
article,
aside,

View File

@ -1323,7 +1323,7 @@ $('.myCarousel').carousel({
<h2>Example</h2>
<p>Start typing in the field below to show the typeahead results.</p>
<div class="well">
<input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-data='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
<input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
</div>
<hr>
<h2>Using bootstrap-typeahead.js</h2>
@ -1340,6 +1340,12 @@ $('.myCarousel').carousel({
</tr>
</thead>
<tbody>
<tr>
<td>source</td>
<td>array</td>
<td>[ ]</td>
<td>The data source to query against.</td>
</tr>
<tr>
<td>items</td>
<td>number</td>

View File

@ -1258,7 +1258,7 @@ $('.myCarousel').carousel({
<h2>{{_i}}Example{{/i}}</h2>
<p>{{_i}}Start typing in the field below to show the typeahead results.{{/i}}</p>
<div class="well">
<input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-data='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
<input type="text" class="span3" style="margin: 0 auto;" data-provide="typeahead" data-items="4" data-source='["Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Dakota","North Carolina","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","West Virginia","Wisconsin","Wyoming"]'>
</div>
<hr>
<h2>{{_i}}Using bootstrap-typeahead.js{{/i}}</h2>
@ -1275,6 +1275,12 @@ $('.myCarousel').carousel({
</tr>
</thead>
<tbody>
<tr>
<td>{{_i}}source{{/i}}</td>
<td>{{_i}}array{{/i}}</td>
<td>[ ]</td>
<td>{{_i}}The data source to query against.{{/i}}</td>
</tr>
<tr>
<td>{{_i}}items{{/i}}</td>
<td>{{_i}}number{{/i}}</td>

View File

@ -25,7 +25,7 @@
this.$element = $(element)
this.options = $.extend({}, $.fn.typeahead.defaults, options)
this.$menu = $(this.options.menu).appendTo('body')
this.data = this.options.data
this.source = this.options.source
this.shown = false
this.listen()
}
@ -79,7 +79,7 @@
q = this.query.toLowerCase()
items = jQuery.grep(this.data, function (item) {
items = jQuery.grep(this.source, function (item) {
if (that.matcher(item, q)) return item
})
@ -229,7 +229,8 @@
}
$.fn.typeahead.defaults = {
items: 8
source: []
, items: 8
, menu: '<ul class="typeahead dropdown-menu"></ul>'
, item: '<li><a href="#"></a></li>'
}