Skip to content

Commit

Permalink
Caja: Fix default format for formatselect element
Browse files Browse the repository at this point in the history
  • Loading branch information
mia-pi-git committed Oct 2, 2023
1 parent 82ca9ec commit 1974428
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion js/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -2154,7 +2154,8 @@ function toId() {
* Used for <formatselect>, 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;
}});
},
Expand Down
2 changes: 1 addition & 1 deletion src/battle-log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') || '',
],
};
Expand Down

0 comments on commit 1974428

Please sign in to comment.