From 878a565f89034a39fbee49424fc95155d25e4e7f Mon Sep 17 00:00:00 2001 From: Caleb James DeLisle Date: Fri, 11 Aug 2017 17:34:51 +0200 Subject: [PATCH] tiny little performance improvement in something that really doesn't need it --- www/common/common-interface.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/www/common/common-interface.js b/www/common/common-interface.js index ded41321c..4c05432f9 100644 --- a/www/common/common-interface.js +++ b/www/common/common-interface.js @@ -304,8 +304,9 @@ define([ // If an element is removed from the UI while a tooltip is applied on that element, the tooltip will get hung // forever, this is a solution which just searches for tooltips which have no corrisponding element and removes // them. - var win = $('#pad-iframe')[0].contentWindow; + var win; $('.tippy-popper').each(function (i, el) { + win = win || $('#pad-iframe')[0].contentWindow; if (win.$('[aria-describedby=' + el.getAttribute('id') + ']').length === 0) { el.remove(); }