visibility.js 602 B

1234567891011121314151617181920
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.visibility = exports.hide = exports.show = void 0;
  4. var traverse_1 = require("./traverse");
  5. function show(element) {
  6. visibility(element, true);
  7. }
  8. exports.show = show;
  9. function hide(element) {
  10. visibility(element, false);
  11. }
  12. exports.hide = hide;
  13. function visibility(element, visiable) {
  14. var value = visiable ? 'visible' : 'hidden';
  15. (0, traverse_1.traverse)(element, function (node) {
  16. node.attr('visibility', value);
  17. });
  18. }
  19. exports.visibility = visibility;
  20. //# sourceMappingURL=visibility.js.map