From 9f4c3a5ac8f4adbfcc732ae9bd12f3e16ab0cff7 Mon Sep 17 00:00:00 2001 From: robjacobs Date: Thu, 14 Jan 2016 09:06:54 -0500 Subject: [PATCH] fix(position): positionArrow descendant selector - The element selector was not limited to direct descendants so nested tooltip/popover arrow elements were getting selected instead of the direct descendant arrow element. Closes #5246 Fixes #5230 --- src/position/position.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/position/position.js b/src/position/position.js index 2a9d368c3b..4b78b604b4 100644 --- a/src/position/position.js +++ b/src/position/position.js @@ -464,17 +464,13 @@ angular.module('ui.bootstrap.position', []) positionArrow: function(elem, placement) { elem = this.getRawNode(elem); - var isTooltip = true; - - var innerElem = elem.querySelector('.tooltip-inner'); - if (!innerElem) { - isTooltip = false; - innerElem = elem.querySelector('.popover-inner'); - } + var innerElem = elem.querySelector('.tooltip-inner, .popover-inner'); if (!innerElem) { return; } + var isTooltip = angular.element(innerElem).hasClass('tooltip-inner'); + var arrowElem = isTooltip ? elem.querySelector('.tooltip-arrow') : elem.querySelector('.arrow'); if (!arrowElem) { return;