Skip to content

Commit

Permalink
only pass unique options through to child nodes in tooltips
Browse files Browse the repository at this point in the history
  • Loading branch information
fat committed Mar 1, 2013
1 parent cf99804 commit 01e0f8c
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
11 changes: 10 additions & 1 deletion docs/assets/js/bootstrap-tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,16 @@
}

, enter: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
var defaults = $.fn[this.type].defaults
, options = {}
, self


this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
}, this)

This comment has been minimized.

Copy link
@pragmaticsc

pragmaticsc Aug 8, 2014

why do you include "this" here?


self = $(e.currentTarget)[this.type](options).data(this.type)

if (!self.options.delay || !self.options.delay.show) return self.show()

Expand Down
11 changes: 10 additions & 1 deletion docs/assets/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,16 @@
}

, enter: function (e) {
var self = $(e.currentTarget)[this.type](this._options).data(this.type)
var defaults = $.fn[this.type].defaults
, options = {}
, self


this._options && $.each(this._options, function (key, value) {
if (defaults[key] != value) options[key] = value
}, this)

This comment has been minimized.

Copy link
@LeEnno

LeEnno Mar 4, 2013

The last argument (this) breaks functionality for me. The key and value params become undefined within the function, so options stays empty. This leads to defaults overwriting this._options.

Deleting the last argument works for me.


self = $(e.currentTarget)[this.type](options).data(this.type)

if (!self.options.delay || !self.options.delay.show) return self.show()

Expand Down
Loading

1 comment on commit 01e0f8c

@cvrebert
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes #6832.

Please sign in to comment.