From c132d54ff7378c7284c483e42e19df3250cdd23e Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Tue, 30 Jul 2013 23:25:29 -0700 Subject: [PATCH] This should fix the sticky tooltip issues Lost some control over positioning based on parents, but we can add data attributes if required --- UI/Shared/Toolbar/Radio/RadioButtonView.js | 3 ++- UI/jQuery/TooltipBinder.js | 19 ++----------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/UI/Shared/Toolbar/Radio/RadioButtonView.js b/UI/Shared/Toolbar/Radio/RadioButtonView.js index 25511a964..7e301931c 100644 --- a/UI/Shared/Toolbar/Radio/RadioButtonView.js +++ b/UI/Shared/Toolbar/Radio/RadioButtonView.js @@ -30,7 +30,8 @@ define( } if (this.model.get('tooltip')) { - this.$el.attr('title', this.model.get('tooltip')) + this.$el.attr('title', this.model.get('tooltip')); + this.$el.attr('data-container', 'body'); } }, diff --git a/UI/jQuery/TooltipBinder.js b/UI/jQuery/TooltipBinder.js index 7e13e1e8b..b4de41b0e 100644 --- a/UI/jQuery/TooltipBinder.js +++ b/UI/jQuery/TooltipBinder.js @@ -3,23 +3,8 @@ define( [ 'bootstrap' ], function () { - $(document).on('mouseenter', '[title]', function () { - var element = $(this); - - if (!element.attr('data-placement') && element.parents('.control-group').length > 0) { - element.attr('data-placement', 'right'); - } - - var container = element.parents('.modal-body'); - if (container.length === 0) { - container = 'body'; - } - - element.tooltip({ - container: container - }); - - element.tooltip('show'); + $('body').tooltip({ + selector: '[title]' }); });