Skip to content

Commit 20cf3ef

Browse files
author
castastrophe
committed
Fix issue with random id function not running; add static
1 parent b6732a7 commit 20cf3ef

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

elements/pfe-modal/src/pfe-modal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,10 @@ class PfeModal extends PFElement {
6464
constructor() {
6565
super(PfeModal, { type: PfeModal.PfeType });
6666

67-
this.open = false;
6867
this.header_id = this.randomId;
6968

69+
this.open = false;
70+
7071
this._keydownHandler = this._keydownHandler.bind(this);
7172
this._toggleModal = this._toggleModal.bind(this);
7273

elements/pfelement/src/pfelement.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ class PFElement extends HTMLElement {
3030
static get version() {
3131
return "{{version}}";
3232
}
33+
34+
static get randomId() {
35+
return Math.random().toString(36).substr(2, 9);
36+
}
3337

3438
get version() {
3539
return this._pfeClass.version;
@@ -38,10 +42,6 @@ class PFElement extends HTMLElement {
3842
get pfeType() {
3943
return this.getAttribute(`${prefix}type`);
4044
}
41-
42-
get randomId() {
43-
return Math.random().toString(36).substr(2, 9);
44-
}
4545

4646
set pfeType(value) {
4747
this.setAttribute(`${prefix}type`, value);

0 commit comments

Comments
 (0)