Skip to content

Commit

Permalink
Tooltip selector regression in v3.3.0 twbs#15168
Browse files Browse the repository at this point in the history
  • Loading branch information
redbmk committed Dec 5, 2014
1 parent ac49a09 commit 465ef28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
12 changes: 4 additions & 8 deletions js/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,12 @@
var $this = $(this)
var data = $this.data('bs.popover')
var options = typeof option == 'object' && option
var selector = options && options.selector
var selector = options && options.selector || ''

if (!data && option == 'destroy') return
if (selector) {
if (!data) $this.data('bs.popover', (data = {}))
if (!data[selector]) data[selector] = new Popover(this, options)
} else {
if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
}
if (typeof option == 'string') data[option]()
if (!data) $this.data('bs.popover', (data = {}))
if (!data[selector]) data[selector] = new Popover(this, options)
if (typeof option == 'string') data[selector][option]()
})
}

Expand Down
12 changes: 4 additions & 8 deletions js/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -448,16 +448,12 @@
var $this = $(this)
var data = $this.data('bs.tooltip')
var options = typeof option == 'object' && option
var selector = options && options.selector
var selector = options && options.selector || ''

if (!data && option == 'destroy') return
if (selector) {
if (!data) $this.data('bs.tooltip', (data = {}))
if (!data[selector]) data[selector] = new Tooltip(this, options)
} else {
if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options)))
}
if (typeof option == 'string') data[option]()
if (!data) $this.data('bs.tooltip', (data = {}))
if (!data[selector]) data[selector] = new Tooltip(this, options)
if (typeof option == 'string') data[selector][option]()
})
}

Expand Down

0 comments on commit 465ef28

Please sign in to comment.