Skip to content

Commit

Permalink
#1083, #1092: Showing tooltip/popover when moving over or clicking th…
Browse files Browse the repository at this point in the history
…e feedback icon (Bootstrap 3.3.0), thanks to @Arkni
  • Loading branch information
nghuuphuoc committed Nov 10, 2014
1 parent 12447de commit 473330c
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Change Log

## v0.6.0 (not released yet)

__Improvements__
* [#1083](https://github.com/nghuuphuoc/bootstrapvalidator/issues/1083), [#1092](https://github.com/nghuuphuoc/bootstrapvalidator/pull/1092/): Showing tooltip/popover when moving over or clicking the feedback icon (Bootstrap 3.3.0), thanks to [@Arkni](https://github.com/Arkni)

## v0.5.3 (2014-11-05)

__New Features__
Expand Down
2 changes: 1 addition & 1 deletion dist/css/bootstrapValidator.min.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* BootstrapValidator (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
*
* @version v0.5.3, built on 2014-11-05 9:14:18 PM
* @version v0.6.0-dev, built on 2014-11-10 11:37:42 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license Commercial: http://bootstrapvalidator.com/license/
Expand Down
10 changes: 5 additions & 5 deletions dist/js/bootstrapValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* BootstrapValidator (http://bootstrapvalidator.com)
* The best jQuery plugin to validate form fields. Designed to use with Bootstrap 3
*
* @version v0.5.3, built on 2014-11-05 9:14:18 PM
* @version v0.6.0-dev, built on 2014-11-10 11:37:42 PM
* @author https://twitter.com/nghuuphuoc
* @copyright (c) 2013 - 2014 Nguyen Huu Phuoc
* @license Commercial: http://bootstrapvalidator.com/license/
Expand Down Expand Up @@ -1124,25 +1124,25 @@ if (typeof jQuery === 'undefined') {
// Only show the first error message if it is placed inside a tooltip ...
case ($icon && 'tooltip' === container):
(isValidField === false)
? $icon.css('cursor', 'pointer').tooltip('destroy').tooltip({
? $icon.css({ 'cursor': 'pointer', 'pointer-events': 'auto' }).tooltip('destroy').tooltip({
container: 'body',
html: true,
placement: 'auto top',
title: $allErrors.filter('[data-bv-result="' + that.STATUS_INVALID + '"]').eq(0).html()
})
: $icon.css('cursor', '').tooltip('destroy');
: $icon.css({ 'cursor': '', 'pointer-events': 'none' }).tooltip('destroy');
break;
// ... or popover
case ($icon && 'popover' === container):
(isValidField === false)
? $icon.css('cursor', 'pointer').popover('destroy').popover({
? $icon.css({ 'cursor': 'pointer', 'pointer-events': 'auto' }).popover('destroy').popover({
container: 'body',
content: $allErrors.filter('[data-bv-result="' + that.STATUS_INVALID + '"]').eq(0).html(),
html: true,
placement: 'auto top',
trigger: 'hover click'
})
: $icon.css('cursor', '').popover('destroy');
: $icon.css({ 'cursor': '', 'pointer-events': 'none' }).popover('destroy');
break;
default:
(status === this.STATUS_INVALID) ? $errors.show() : $errors.hide();
Expand Down
4 changes: 2 additions & 2 deletions dist/js/bootstrapValidator.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/js/bootstrapValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1124,25 +1124,25 @@ if (typeof jQuery === 'undefined') {
// Only show the first error message if it is placed inside a tooltip ...
case ($icon && 'tooltip' === container):
(isValidField === false)
? $icon.css({"cursor" : "pointer", "pointer-events" : "auto"}).tooltip('destroy').tooltip({
? $icon.css({ 'cursor': 'pointer', 'pointer-events': 'auto' }).tooltip('destroy').tooltip({
container: 'body',
html: true,
placement: 'auto top',
title: $allErrors.filter('[data-bv-result="' + that.STATUS_INVALID + '"]').eq(0).html()
})
: $icon.css({"cursor" : "", "pointer-events" : "none"}).tooltip('destroy');
: $icon.css({ 'cursor': '', 'pointer-events': 'none' }).tooltip('destroy');
break;
// ... or popover
case ($icon && 'popover' === container):
(isValidField === false)
? $icon.css({"cursor" : "pointer", "pointer-events" : "auto"}).popover('destroy').popover({
? $icon.css({ 'cursor': 'pointer', 'pointer-events': 'auto' }).popover('destroy').popover({
container: 'body',
content: $allErrors.filter('[data-bv-result="' + that.STATUS_INVALID + '"]').eq(0).html(),
html: true,
placement: 'auto top',
trigger: 'hover click'
})
: $icon.css({"cursor" : "", "pointer-events" : "none"}).popover('destroy');
: $icon.css({ 'cursor': '', 'pointer-events': 'none' }).popover('destroy');
break;
default:
(status === this.STATUS_INVALID) ? $errors.show() : $errors.hide();
Expand Down

0 comments on commit 473330c

Please sign in to comment.