topical media & game development
mobile-query-three-www-vendor-doccoviewer-vendor-bootstrap-js-bootstrap-typeahead.js / js
/* =============================================================
* bootstrap-typeahead.js v2.0.0
* http://twitter.github.com/bootstrap/javascript.html#typeahead
* =============================================================
* Copyright 2012 Twitter, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============================================================ */
!function( element = element
this.options = .fn.typeahead.defaults, options)
this.matcher = this.options.matcher || this.matcher
this.sorter = this.options.sorter || this.sorter
this.highlighter = this.options.highlighter || this.highlighter
this.menu.find('.active').attr('data-value')
this..extend({}, this.element[0].offsetHeight
})
this.menu.show()
this.shown = true
return this
}
, hide: function () {
this.element.val()
if (!this.query) {
return this.shown ? this.hide() : this
}
items = menu.html(items)
return this
}
, next: function (event) {
var active = this.menu.find('li')[0])
}
next.addClass('active')
}
, prev: function (event) {
var active = this.menu.find('li').last()
}
prev.addClass('active')
}
, listen: function () {
this..proxy(this.blur, this))
.on('keypress', .proxy(this.keyup, this))
if (.browser.msie) {
this..proxy(this.keypress, this))
}
this..proxy(this.click, this))
.on('mouseenter', 'li', menu.find('.active').removeClass('active')
$(e.currentTarget).addClass('active')
}
}
/* TYPEAHEAD PLUGIN DEFINITION
* =========================== */
this = this
, data = this.data('typeahead', (data = new Typeahead(this, options)))
if (typeof option == 'string') data[option]()
})
}
.fn.typeahead.Constructor = Typeahead
/* TYPEAHEAD DATA-API
* ================== */
$(function () {
$('body').on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) {
var this.data('typeahead')) return
e.preventDefault()
this.data())
})
})
}( window.jQuery )
(C) Æliens
04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.