From 45dddc59a19f3e9decaa4bf0e0db3f884a0f6ff7 Mon Sep 17 00:00:00 2001 From: Jacob Thornton Date: Sat, 18 Aug 2012 19:54:30 -0700 Subject: add click option for tooltip, popover - make click default for popover --- docs/assets/js/bootstrap.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'docs/assets/js/bootstrap.js') diff --git a/docs/assets/js/bootstrap.js b/docs/assets/js/bootstrap.js index 269fb206f..938dac9b4 100644 --- a/docs/assets/js/bootstrap.js +++ b/docs/assets/js/bootstrap.js @@ -1006,8 +1006,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)) @@ -1330,6 +1332,7 @@ $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { placement: 'right' + , trigger: 'click' , content: '' , template: '

' }) -- cgit v1.2.3