1
0
mirror of https://github.com/exane/not-gwent-online synced 2025-07-31 04:43:35 +00:00

more lobby stuff

This commit is contained in:
exane
2015-07-01 19:51:09 +02:00
parent cdbb5443af
commit 05af359b85
6 changed files with 27 additions and 101 deletions

@@ -843,7 +843,10 @@ let Lobby = Backbone.View.extend({
initialize: function(options){
this.user = options.user;
this.app = options.app;
this.listenTo(this.app.user, "change", this.render);
this.app.receive("update:playerOnline", this.renderStatus.bind(this));
this.listenTo(this.app.user, "change:serverOffline", this.render);
$(".gwent-battle").html(this.el);
this.render();
},
@@ -863,6 +866,7 @@ let Lobby = Backbone.View.extend({
return this;
},
startMatchmaking: function(){
this.$el.find(".image-gif-loader").show();
this.app.trigger("startMatchmaking");
},
joinRoom: function(){
@@ -876,6 +880,9 @@ let Lobby = Backbone.View.extend({
changeName: function(e){
let name = $(e.target).val();
this.app.trigger("setName", name);
},
renderStatus: function(n) {
this.$el.find(".nr-player-online").html(n);
}
});