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:
Guangcong Luo
2015-05-06 03:25:57 -04:00
parent 7e57295ef2
commit 063556f0ec

View File

@@ -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');