Improved next game routing and speed. Hid that catastrophically dangerous reset all games button.
This commit is contained in:
parent
e88c79681d
commit
f02f4e77d0
3 changed files with 13 additions and 7 deletions
app
|
@ -154,7 +154,7 @@ module.exports = class CocoRouter extends Backbone.Router
|
||||||
|
|
||||||
onNavigate: (e) ->
|
onNavigate: (e) ->
|
||||||
manualView = e.view or e.viewClass
|
manualView = e.view or e.viewClass
|
||||||
@navigate e.route, {trigger:not manualView}
|
@navigate e.route, {trigger: not manualView}
|
||||||
return unless manualView
|
return unless manualView
|
||||||
if e.viewClass
|
if e.viewClass
|
||||||
args = e.viewArgs or []
|
args = e.viewArgs or []
|
||||||
|
|
|
@ -44,6 +44,6 @@ block content
|
||||||
span(data-i18n="ladder.simulation_explanation") By simulating games you can get your game ranked faster!
|
span(data-i18n="ladder.simulation_explanation") By simulating games you can get your game ranked faster!
|
||||||
p
|
p
|
||||||
button(data-i18n="ladder.simulate_games").btn.btn-warning.btn-lg.highlight#simulate-button Simulate Games!
|
button(data-i18n="ladder.simulate_games").btn.btn-warning.btn-lg.highlight#simulate-button Simulate Games!
|
||||||
if me.isAdmin()
|
if false && me.isAdmin()
|
||||||
p
|
p
|
||||||
button(data-i18n="ladder.simulate_all").btn.btn-danger.btn-lg.highlight#simulate-all-button RESET AND SIMULATE GAMES
|
button(data-i18n="ladder.simulate_all").btn.btn-danger.btn-lg.highlight#simulate-all-button RESET AND SIMULATE GAMES
|
||||||
|
|
|
@ -66,7 +66,6 @@ module.exports = class SpectateLevelView extends View
|
||||||
'ctrl+s': 'onCtrlS'
|
'ctrl+s': 'onCtrlS'
|
||||||
|
|
||||||
constructor: (options, @levelID) ->
|
constructor: (options, @levelID) ->
|
||||||
@originalOptions = _.cloneDeep(options)
|
|
||||||
console.profile?() if PROFILE_ME
|
console.profile?() if PROFILE_ME
|
||||||
super options
|
super options
|
||||||
$(window).on('resize', @onWindowResize)
|
$(window).on('resize', @onWindowResize)
|
||||||
|
@ -446,7 +445,14 @@ module.exports = class SpectateLevelView extends View
|
||||||
Backbone.Mediator.publish 'router:navigate', {
|
Backbone.Mediator.publish 'router:navigate', {
|
||||||
route: url,
|
route: url,
|
||||||
viewClass: SpectateLevelView,
|
viewClass: SpectateLevelView,
|
||||||
viewArgs: [{spectateSessions:{sessionOne: @sessionOne, sessionTwo: @sessionTwo}}, @levelID ]}
|
viewArgs: [
|
||||||
|
{
|
||||||
|
spectateSessions: {sessionOne: @sessionOne, sessionTwo: @sessionTwo}
|
||||||
|
supermodel: @supermodel
|
||||||
|
}
|
||||||
|
@levelID ]
|
||||||
|
}
|
||||||
|
history?.pushState? {}, "", url # Backbone won't update the URL if just query parameters change
|
||||||
|
|
||||||
fetchRandomSessionPair: (cb) ->
|
fetchRandomSessionPair: (cb) ->
|
||||||
console.log "Fetching random session pair!"
|
console.log "Fetching random session pair!"
|
||||||
|
|
Reference in a new issue