From 465ef287fca94e6516b72ec71fdc2065e3d7ec90 Mon Sep 17 00:00:00 2001 From: "Braden M. Kelley" Date: Thu, 4 Dec 2014 17:23:15 -0800 Subject: [PATCH] Tooltip selector regression in v3.3.0 #15168 --- js/popover.js | 12 ++++-------- js/tooltip.js | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/js/popover.js b/js/popover.js index db272bdee412..86f1588d7d2a 100644 --- a/js/popover.js +++ b/js/popover.js @@ -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]() }) } diff --git a/js/tooltip.js b/js/tooltip.js index cda147d9c701..c84a19aa8976 100644 --- a/js/tooltip.js +++ b/js/tooltip.js @@ -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]() }) }