mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-10-02 15:53:11 -05:00
Nicer Ignore Spectators button
Technically, it's a checkbox now, but the point is that a checkbox is nicer than a button.
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
|
||||
this.$chat = this.$chatFrame.find('.inner');
|
||||
|
||||
this.$options = this.battle.optionsElem.html('<button name="toggleIgnoreSpects">' + (this.battle.ignoreSpects ? 'Unignore' : 'Ignore') + ' Spectators</button>');
|
||||
this.$options = this.battle.optionsElem.html('<label style="font-size: 8pt; padding-left: 5px"><input type="checkbox" name="ignorespects" /> Ignore Spectators</label>');
|
||||
|
||||
this.battle.customCallback = _.bind(this.updateControls, this);
|
||||
this.battle.endCallback = _.bind(this.updateControls, this);
|
||||
@@ -31,6 +31,9 @@
|
||||
|
||||
this.battle.play();
|
||||
},
|
||||
events: {
|
||||
'change input[name=ignorespects]': 'toggleIgnoreSpects'
|
||||
},
|
||||
battleEnded: false,
|
||||
join: function() {
|
||||
app.send('/join '+this.id);
|
||||
@@ -685,9 +688,8 @@
|
||||
setTimer: function(setting) {
|
||||
this.send('/timer '+setting);
|
||||
},
|
||||
toggleIgnoreSpects: function() {
|
||||
this.battle.ignoreSpects = !this.battle.ignoreSpects;
|
||||
this.$options.html('<button name="toggleIgnoreSpects">' + (this.battle.ignoreSpects ? 'Unignore' : 'Ignore') + ' Spectators</button>');
|
||||
toggleIgnoreSpects: function(e) {
|
||||
this.battle.ignoreSpects = !!e.currentTarget.checked;
|
||||
},
|
||||
forfeit: function() {
|
||||
this.send('/forfeit');
|
||||
|
||||
Reference in New Issue
Block a user