Fix a bug in the script form of x-action
Fix a bug in the script form of x-action
diff --git a/css/game.css b/css/game.css
index 4dc92bc..dae38e0 100644
--- a/css/game.css
+++ b/css/game.css
@@ -109,7 +109,7 @@ x-action
transition: left .25s ease-in;
top: 0px;
padding-top: 23px;
- width: calc(100% - 300px);
+ width: calc(100% - 320px);
}
.rtl
{
diff --git a/js/game.js b/js/game.js
index fac2b2a..ba64950 100644
--- a/js/game.js
+++ b/js/game.js
@@ -1441,7 +1441,9 @@ class Game
if (typeof hash_matches[3] !== 'undefined') {
args = hash_matches[3].split(",");
}
- if (action && action.tagName == 'X-ACTION') {
+ if (action && action.tagName == 'X-ACTION'
+ || (action.tagName == 'SCRIPT' &&
+ action.getAttribute('type') == 'text/action')) {
let code = action.innerHTML;
if (code) {
this.evaluateAction(code, args);