Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <jacobthornton@gmail.com>2012-08-19 06:54:30 +0400
committerJacob Thornton <jacobthornton@gmail.com>2012-08-19 06:54:30 +0400
commit45dddc59a19f3e9decaa4bf0e0db3f884a0f6ff7 (patch)
tree39616e8cd0f2c6b5f7c94a90a8e637ce263137c3 /js/bootstrap-tooltip.js
parent44e35e9dfa33fe618218c770f0495bd9596f3485 (diff)
add click option for tooltip, popover - make click default for popover
Diffstat (limited to 'js/bootstrap-tooltip.js')
-rw-r--r--js/bootstrap-tooltip.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/bootstrap-tooltip.js b/js/bootstrap-tooltip.js
index 1e681627ad..0b3230bc1f 100644
--- a/js/bootstrap-tooltip.js
+++ b/js/bootstrap-tooltip.js
@@ -44,8 +44,10 @@
this.options = this.getOptions(options)
this.enabled = true
- if (this.options.trigger != 'manual') {
- eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
+ if (this.options.trigger == 'click') {
+ this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this))
+ } else if (this.options.trigger != 'manual') {
+ eventIn = this.options.trigger == 'hover' ? 'mouseenter' : 'focus'
eventOut = this.options.trigger == 'hover' ? 'mouseleave' : 'blur'
this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this))
this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this))