Skip to content

Commit

Permalink
- still can't get users to display...to be continued.
Browse files Browse the repository at this point in the history
  • Loading branch information
ritzalam committed Oct 26, 2012
1 parent a894397 commit 2b92bf0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion labs/html5-embed/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<button type="button" onclick="sendPublicChat()">Send Public Chat</button>
<button type="button" onclick="sendPrivateChat()">Send Private Chat</button>
</div>
<div id="layout">
<div id="layout" class="users-enabled">
<div id="content" style="display: block">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="BigBlueButton" name="BigBlueButton" align="middle">
<param name="movie" value="http://192.168.0.249/client/BigBlueButton.swf?v=VERSION" />
Expand Down
14 changes: 9 additions & 5 deletions labs/html5-embed/public/js/views/users/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ define([
'underscore',
'backbone',
'collections/users',
'views/users/user'
], function($, _, Backbone, UserCollection, UserView){
'views/users/user',
'text!templates/users/users.html'
], function($, _, Backbone, UserCollection, UserView, usersTemplate){

var UsersView = Backbone.View.extend({
el: $("#users-list"),
el: 'ul',
initialize: function(){
UserCollection.on('add', this.addUser, this);
},
Expand All @@ -21,10 +22,13 @@ define([
// this.$el.html( compiledTemplate );
},
addUser: function(user) {
var compiledTemplate = _.template( usersTemplate);
// this.$el.html( compiledTemplate );
console.log("Adding user [" + user.get("username") + "]");
var view = new UserView({model: user});
console.log("Rendering [" + view.render().el.html() + "]");
this.$el.append('<li>Hello</li>');

this.$el.append(view.render().el);
console.log("Rendering [" + this.$el.html() + "]");
}
});

Expand Down
4 changes: 2 additions & 2 deletions labs/html5-embed/public/js/views/users/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ define([
console.log("Render me! [" + this.model.get("username") + "]");
var compiledTemplate = _.template(userTemplate, this.model);
console.log("user is " + compiledTemplate);
this.$el.append(compiledTemplate);
console.log(this.$el.append(compiledTemplate));
this.$el.html(compiledTemplate);
// console.log(this.$el.append(compiledTemplate));
return this;
//return compiledTemplate;
}
Expand Down
1 change: 1 addition & 0 deletions labs/html5-embed/public/templates/users/users.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<ul id="users-list"></ul>

0 comments on commit 2b92bf0

Please sign in to comment.