Skip to content

Commit 665ee8d

Browse files
43081jshs96c
authored andcommitted
move displayed to a function
1 parent 011338d commit 665ee8d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

javascript/atoms/dom.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,12 @@ bot.dom.isShown_ = function(elem, ignoreOpacity, parentsDisplayedFn) {
565565
* @return {boolean} Whether or not the element is visible.
566566
*/
567567
bot.dom.isShown = function(elem, opt_ignoreOpacity) {
568-
var displayed;
569-
570-
// Any element with a display style equal to 'none' or that has an ancestor
571-
// with display style equal to 'none' is not shown.
572-
displayed = function(e) {
568+
/**
569+
* Determines whether an element or its parents have `display: none` set
570+
* @param {?Node}
571+
* @return {boolean}
572+
*/
573+
function displayed(e) {
573574
if (bot.dom.isElement(e) && bot.dom.getEffectiveStyle(e, 'display') == 'none') {
574575
return false;
575576
}
@@ -593,7 +594,7 @@ bot.dom.isShown = function(elem, opt_ignoreOpacity) {
593594
}
594595

595596
return parent && displayed(parent);
596-
};
597+
}
597598

598599
return bot.dom.isShown_(elem, !!opt_ignoreOpacity, displayed);
599600
};

0 commit comments

Comments
 (0)