PageSourceSearch

https://ul.org/wp-content/themes/ul/dist/block-editor/blocks/panels/view-script.js?ver=1789962530

js ul.org collected 2026-09-24 09:18:40 UTC 5,785 bytes, 141 lines download raw bytes

1/******/ (function() { // webpackBootstrap
2/******/ 	// runtime can't be in strict mode because a global variable is assign and maybe created.
3/******/ 	// The require scope
4/******/ 	var __webpack_require__ = {};
5/******/ 	
6/************************************************************************/
7/******/ 	/* webpack/runtime/define property getters */
8/******/ 	!function() {
9/******/ 		// define getter functions for harmony exports
10/******/ 		__webpack_require__.d = function(exports, definition) {
11/******/ 			for(var key in definition) {
12/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
13/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
14/******/ 				}
15/******/ 			}
16/******/ 		};
17/******/ 	}();
18/******/ 	
19/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
20/******/ 	!function() {
21/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
22/******/ 	}();
23/******/ 	
24/******/ 	/* webpack/runtime/make namespace object */
25/******/ 	!function() {
26/******/ 		// define __esModule on exports
27/******/ 		__webpack_require__.r = function(exports) {
28/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
29/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
30/******/ 			}
31/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
32/******/ 		};
33/******/ 	}();
34/******/ 	
35/************************************************************************/
36var __webpack_exports__ = {};
37// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
38!function() {
39"use strict";
40/*!***************************************************!*\
41  !*** ./block-editor/blocks/panels/view-script.js ***!
42  \***************************************************/
43__webpack_require__.r(__webpack_exports__);
44/* harmony export */ __webpack_require__.d(__webpack_exports__, {
45/* harmony export */   Panel: function() { return /* binding */ Panel; },
46/* harmony export */   Panels: function() { return /* binding */ Panels; }
47/* harmony export */ });
48class Panel {
49  constructor(node, opts) {
50    this.node = node;
51    this.opts = {
52      title: '.panels__title',
53      toggle: '.panels__toggle',
54      content: '.panels__content',
55      openedClass: 'panels__panel--opened',
56      ...opts
57    };
58    this.opened = this.node.classList.contains(this.opts.openedClass);
59    this.title = this.node.querySelector(this.opts.title);
60    this.toggle = this.node.querySelector(this.opts.toggle);
61    this.content = this.node.querySelector(this.opts.content);
62    if (this.toggle) {
63      this.toggle.addEventListener('click', () => this.togglePanel());
64    }
65  }
66  open() {
67    this.node.classList.add(this.opts.openedClass);
68    this.toggle.setAttribute('aria-expanded', 'true');
69    this.content.style.display = 'block';
70    let height = this.content.offsetHeight;
71    this.content.style.height = '0px';
72    this.content.style.overflow = 'hidden';
73    let transitionend = e => {
74      this.content.removeAttribute('style');
75      this.opened = true;
76      this.content.removeEventListener('transitionend', transitionend);
77    };
78    this.content.addEventListener('transitionend', transitionend);
79    this.content.style.transitionProperty = 'height, opacity';
80    this.content.style.transitionDuration = '300ms';
81    this.content.style.transitionTimingFunction = 'cubic-bezier(0.45, 0, 0.55, 1), linear';
82    requestAnimationFrame(() => {
83      requestAnimationFrame(() => {
84        this.content.style.height = `${height}px`;
85        this.content.style.opacity = 1;
86      });
87    });
88  }
89  close() {
90    this.node.classList.remove(this.opts.openedClass);
91    this.toggle.setAttribute('aria-expanded', 'false');
92    this.content.style.display = 'block';
93    this.content.style.overflow = 'hidden';
94    this.content.style.height = `${this.content.offsetHeight}px`;
95    this.content.style.transitionProperty = 'height, opacity';
96    this.content.style.transitionDuration = '300ms';
97    this.content.style.transitionTimingFunction = 'cubic-bezier(0.45, 0, 0.55, 1), linear';
98    let transitionend = e => {
99      this.content.removeAttribute('style');
100      this.opened = false;
101      this.content.removeEventListener('transitionend', transitionend);
102    };
103    this.content.addEventListener('transitionend', transitionend);
104    requestAnimationFrame(() => {
105      requestAnimationFrame(() => {
106        this.content.style.height = '0';
107        this.content.style.opacity = 0;
108      });
109    });
110  }
111  togglePanel() {
112    return this.opened ? this.close() : this.open();
113  }
114}
115class Panels {
116  constructor(node, opts) {
117    this.node = node;
118    this.opts = {
119      interactiveClass: 'panels--interactive',
120      panels: '.panels__panel',
121      ...opts
122    };
123    this.node.classList.add(this.opts.interactiveClass);
124    this.panels = Array.from(this.node.querySelectorAll(this.opts.panels)).map(node => new Panel(node, this.opts));
125  }
126}
127Panels.instances = Array.from(document.querySelectorAll('.panels')).map(node => new Panels(node));
128
129// re initialize ajax loaded panels
130document.body.addEventListener('wdg:fetch:refresh', () => {
131  document.querySelectorAll('.panels:not(.panels--interactive').forEach(node => {
132    Panels.instances.push(new Panels(node));
133  });
134});
135}();
136var __webpack_export_target__ = (wdg.blocks.panelsViewScript = typeof wdg.blocks.panelsViewScript === "undefined" ? {} : wdg.blocks.panelsViewScript);
137for(var i in __webpack_exports__) __webpack_export_target__[i] = __webpack_exports__[i];
138if(__webpack_exports__.__esModule) Object.defineProperty(__webpack_export_target__, "__esModule", { value: true });
139/******/ })()
140;
141//# sourceMappingURL=view-script.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.