Code coverage report for lib/elements/visibility.js

Statements: 45.45% (5 / 11)      Branches: 0% (0 / 2)      Functions: 0% (0 / 4)      Lines: 45.45% (5 / 11)      Ignored: none     

All files » lib/elements/ » visibility.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46    1             1                 1                 1                           1        
'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