@pie-element/ebsr 10.3.5-next.15 → 10.3.5-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/module/element.js +11 -3
- package/module/print.js +11 -3
- package/package.json +3 -3
package/module/element.js
CHANGED
|
@@ -13120,6 +13120,8 @@ class MultipleChoice extends HTMLElement {
|
|
|
13120
13120
|
this._model = null;
|
|
13121
13121
|
this._session = null;
|
|
13122
13122
|
this.audioComplete = false;
|
|
13123
|
+
this._boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
13124
|
+
this._keyboardEventsEnabled = false;
|
|
13123
13125
|
this._rerender = debounce(() => {
|
|
13124
13126
|
if (this._model && this._session) {
|
|
13125
13127
|
var element = React.createElement(Root, {
|
|
@@ -13135,7 +13137,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
13135
13137
|
log$1('render complete - render math');
|
|
13136
13138
|
renderMath(this);
|
|
13137
13139
|
});
|
|
13138
|
-
if (this._model.keyboardEventsEnabled === true) {
|
|
13140
|
+
if (this._model.keyboardEventsEnabled === true && !this._keyboardEventsEnabled) {
|
|
13139
13141
|
this.enableKeyboardEvents();
|
|
13140
13142
|
}
|
|
13141
13143
|
} else {
|
|
@@ -13262,10 +13264,16 @@ class MultipleChoice extends HTMLElement {
|
|
|
13262
13264
|
});
|
|
13263
13265
|
}
|
|
13264
13266
|
enableKeyboardEvents() {
|
|
13265
|
-
|
|
13267
|
+
if (!this._keyboardEventsEnabled) {
|
|
13268
|
+
window.addEventListener('keydown', this._boundHandleKeyDown);
|
|
13269
|
+
this._keyboardEventsEnabled = true;
|
|
13270
|
+
}
|
|
13266
13271
|
}
|
|
13267
13272
|
disconnectedCallback() {
|
|
13268
|
-
|
|
13273
|
+
if (this._keyboardEventsEnabled) {
|
|
13274
|
+
window.removeEventListener('keydown', this._boundHandleKeyDown);
|
|
13275
|
+
this._keyboardEventsEnabled = false;
|
|
13276
|
+
}
|
|
13269
13277
|
}
|
|
13270
13278
|
handleKeyDown(event) {
|
|
13271
13279
|
if (!this._model || !this._session) {
|
package/module/print.js
CHANGED
|
@@ -13120,6 +13120,8 @@ class MultipleChoice extends HTMLElement {
|
|
|
13120
13120
|
this._model = null;
|
|
13121
13121
|
this._session = null;
|
|
13122
13122
|
this.audioComplete = false;
|
|
13123
|
+
this._boundHandleKeyDown = this.handleKeyDown.bind(this);
|
|
13124
|
+
this._keyboardEventsEnabled = false;
|
|
13123
13125
|
this._rerender = debounce(() => {
|
|
13124
13126
|
if (this._model && this._session) {
|
|
13125
13127
|
var element = React.createElement(Root, {
|
|
@@ -13135,7 +13137,7 @@ class MultipleChoice extends HTMLElement {
|
|
|
13135
13137
|
log$1('render complete - render math');
|
|
13136
13138
|
renderMath(this);
|
|
13137
13139
|
});
|
|
13138
|
-
if (this._model.keyboardEventsEnabled === true) {
|
|
13140
|
+
if (this._model.keyboardEventsEnabled === true && !this._keyboardEventsEnabled) {
|
|
13139
13141
|
this.enableKeyboardEvents();
|
|
13140
13142
|
}
|
|
13141
13143
|
} else {
|
|
@@ -13262,10 +13264,16 @@ class MultipleChoice extends HTMLElement {
|
|
|
13262
13264
|
});
|
|
13263
13265
|
}
|
|
13264
13266
|
enableKeyboardEvents() {
|
|
13265
|
-
|
|
13267
|
+
if (!this._keyboardEventsEnabled) {
|
|
13268
|
+
window.addEventListener('keydown', this._boundHandleKeyDown);
|
|
13269
|
+
this._keyboardEventsEnabled = true;
|
|
13270
|
+
}
|
|
13266
13271
|
}
|
|
13267
13272
|
disconnectedCallback() {
|
|
13268
|
-
|
|
13273
|
+
if (this._keyboardEventsEnabled) {
|
|
13274
|
+
window.removeEventListener('keydown', this._boundHandleKeyDown);
|
|
13275
|
+
this._keyboardEventsEnabled = false;
|
|
13276
|
+
}
|
|
13269
13277
|
}
|
|
13270
13278
|
handleKeyDown(event) {
|
|
13271
13279
|
if (!this._model || !this._session) {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/ebsr",
|
|
3
|
-
"version": "10.3.5-next.
|
|
3
|
+
"version": "10.3.5-next.21+bad3964ad",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "pie-framework/pie-elements",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@pie-element/multiple-choice": "^9.11.1-next.
|
|
10
|
+
"@pie-element/multiple-choice": "^9.11.1-next.21+bad3964ad",
|
|
11
11
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
12
12
|
"@pie-lib/pie-toolbox": "2.9.0",
|
|
13
13
|
"classnames": "^2.2.5",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"author": "pie framework developers",
|
|
18
18
|
"license": "ISC",
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "bad3964ad2249d589641fe51c401c73d8bd11e2e",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|