diff options
author | XhmikosR <xhmikosr@gmail.com> | 2019-11-08 11:11:23 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-08 11:11:23 +0300 |
commit | cc6f66f72a180af1910bb5f520f2067ad705f1b8 (patch) | |
tree | 52936e0cea75f13d2a98541825bfc90444235330 /js/dist/dropdown.js | |
parent | eb849d73cda18a660d13c22b25a9e7ebbf42faca (diff) |
Dist (#29638)
Diffstat (limited to 'js/dist/dropdown.js')
-rw-r--r-- | js/dist/dropdown.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/js/dist/dropdown.js b/js/dist/dropdown.js index 6044c5831b..ab8e425280 100644 --- a/js/dist/dropdown.js +++ b/js/dist/dropdown.js @@ -7,7 +7,7 @@ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('./dom/data.js'), require('./dom/event-handler.js'), require('./dom/manipulator.js'), require('popper.js'), require('./dom/selector-engine.js')) : typeof define === 'function' && define.amd ? define(['./dom/data.js', './dom/event-handler.js', './dom/manipulator.js', 'popper.js', './dom/selector-engine.js'], factory) : (global = global || self, global.Dropdown = factory(global.Data, global.EventHandler, global.Manipulator, global.Popper, global.SelectorEngine)); -}(this, function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict'; +}(this, (function (Data, EventHandler, Manipulator, Popper, SelectorEngine) { 'use strict'; Data = Data && Data.hasOwnProperty('default') ? Data['default'] : Data; EventHandler = EventHandler && EventHandler.hasOwnProperty('default') ? EventHandler['default'] : EventHandler; @@ -131,6 +131,20 @@ return [].slice.call(nodeList); }; + var isVisible = function isVisible(element) { + if (!element) { + return false; + } + + if (element.style && element.parentNode && element.parentNode.style) { + var elementStyle = getComputedStyle(element); + var parentNodeStyle = getComputedStyle(element.parentNode); + return elementStyle.display !== 'none' && parentNodeStyle.display !== 'none' && elementStyle.visibility !== 'hidden'; + } + + return false; + }; + var noop = function noop() { return function () {}; }; @@ -576,7 +590,7 @@ return; } - var items = makeArray(SelectorEngine.find(Selector.VISIBLE_ITEMS, parent)); + var items = makeArray(SelectorEngine.find(Selector.VISIBLE_ITEMS, parent)).filter(isVisible); if (!items.length) { return; @@ -666,5 +680,5 @@ return Dropdown; -})); +}))); //# sourceMappingURL=dropdown.js.map |