mirror of
https://github.com/exane/not-gwent-online
synced 2024-12-23 21:03:14 +00:00
fiiiixx
This commit is contained in:
parent
346f8968d7
commit
f68dae1532
@ -1,46 +0,0 @@
|
||||
var Backbone = require("backbone");
|
||||
var Handlebars = require("handlebars");
|
||||
var $ = require("jquery");
|
||||
|
||||
var Lobby = Backbone.View.extend({
|
||||
defaults: {
|
||||
id: ""
|
||||
},
|
||||
className: "container",
|
||||
|
||||
template: Handlebars.compile($("#matchmaker-template").html()),
|
||||
initialize: function(){
|
||||
this.app = app;
|
||||
this.listenTo(app.user, "change", this.render);
|
||||
$(this.el).prependTo('body');
|
||||
this.render();
|
||||
},
|
||||
events: {
|
||||
"click .create-room": "createRoom",
|
||||
"click .join-room": "joinRoom",
|
||||
"blur .name-input": "changeName",
|
||||
"change #deckChoice": "setDeck"
|
||||
},
|
||||
render: function(){
|
||||
this.$el.html(this.template(this.app.user.attributes));
|
||||
//this.$el.find("#deckChoice option[value='" + this.app.user.get("setDeck") + "']").attr("selected", "selected")
|
||||
return this;
|
||||
},
|
||||
createRoom: function(){
|
||||
this.app.send("request:createRoom");
|
||||
},
|
||||
joinRoom: function(){
|
||||
this.app.send("request:joinRoom");
|
||||
},
|
||||
setDeck: function(e){
|
||||
var val = $(e.target).val();
|
||||
this.app.user.setDeck(val);
|
||||
},
|
||||
changeName: function(e){
|
||||
var name = $(e.target).val();
|
||||
this.app.user.setName(name);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
module.exports = Lobby;
|
@ -70,7 +70,7 @@ var User = (function(){
|
||||
}
|
||||
|
||||
r.getDeck = function() {
|
||||
return this._deck || "northern_realm";
|
||||
return this._deck || "northern";
|
||||
}
|
||||
|
||||
r.addRoom = function(room) {
|
||||
|
Loading…
Reference in New Issue
Block a user