'use strict';
var elements = require('../elements');
/**
* Check if the element is visible (display !== none)
* @param {HTMLElement} elt
* @return {Boolean}
*/
elements.isVisible = /** @function
* @param elt */function (elt) {
return elements.getStyle(elt, 'display') !== 'none';
};
/**
* Hide an element using the hidden class
* @param {HTMLElement} elt
*/
elements.hide = /** @function
* @param elt */function (elt) {
elements.addClass(elt, 'hidden');
};
/**
* Hide an element using the hidden class
* @param {HTMLElement} elt
*/
elements.show = /** @function
* @param elt */function (elt) {
if (elt.style.display === 'none') {
elt.style.display = '';
}
elements.removeClass(elt, 'hidden');
};
/**
* Toggle an element's visibility using the hidden class
* @param {HTMLElement} elt
* @return {boolean}
*/
elements.toggle = /** @function
* @param elt */function (elt) {
return elements.toggleClass(elt, 'hidden');
};
//# sourceMappingURL=visibility.js.map |