From 1974428b14fee043af21ddc4017a2eb27299c3b1 Mon Sep 17 00:00:00 2001 From: Mia <49593536+mia-pi-git@users.noreply.github.com> Date: Mon, 2 Oct 2023 09:45:54 -0500 Subject: [PATCH] Caja: Fix default format for formatselect element --- js/client.js | 3 ++- src/battle-log.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/js/client.js b/js/client.js index 17fea020db..3c04e0b8d2 100644 --- a/js/client.js +++ b/js/client.js @@ -2154,7 +2154,8 @@ function toId() { * Used for , does format popup and caches value in button value */ selectformat: function (value, target) { - app.addPopup(FormatPopup, {format: 'gen9randombattle', sourceEl: target, selectType: 'watch', onselect: function (newFormat) { + var format = value || 'gen9randombattle'; + app.addPopup(FormatPopup, {format: format, sourceEl: target, selectType: 'watch', onselect: function (newFormat) { target.value = newFormat; }}); }, diff --git a/src/battle-log.ts b/src/battle-log.ts index 2cb54df917..3223c45288 100644 --- a/src/battle-log.ts +++ b/src/battle-log.ts @@ -922,7 +922,7 @@ export class BattleLog { attribs: [ 'type', 'selectformat', 'class', "select formatselect", - 'value', getAttrib('value') || "gen9randombattle", + 'value', getAttrib('format') || getAttrib('value') || '', 'name', getAttrib('name') || '', ], };