Skip to content

Commit

Permalink
Add upload button to room
Browse files Browse the repository at this point in the history
  • Loading branch information
hhaidar committed Feb 6, 2015
1 parent ac9de36 commit 8378aba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion media/js/views/room.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
'click .hide-edit-room': 'hideEditRoom',
'click .submit-edit-room': 'submitEditRoom',
'click .archive-room': 'archiveRoom',
'click .lcb-room-poke': 'poke'
'click .lcb-room-poke': 'poke',
'click .lcb-upload-trigger': 'upload'
},
initialize: function(options) {
this.client = options.client;
Expand Down Expand Up @@ -387,6 +388,10 @@
text = $.trim($input.val()),
at = (text.length > 0 ? ' ' : '') + '@' + user.get('username') + ' '
$input.val(text + at).focus();
},
upload: function(e) {
e.preventDefault();
this.model.trigger('upload:show', this.model);
}
});

Expand Down
1 change: 1 addition & 0 deletions media/js/views/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Dropzone && (Dropzone.autoDiscover = false);
this.template = Handlebars.compile($('#template-upload-preview').html());
this.rooms = options.rooms;
this.rooms.on('add remove', this.populateRooms, this);
this.rooms.on('upload:show', this.show, this)
this.render();
},
render: function() {
Expand Down
5 changes: 4 additions & 1 deletion templates/includes/js/room.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ <h2 class="lcb-room-heading">
href="transcript?room={{ id }}" target="_blank">
<i class="fa fa-history"></i>
</a>
</h2>
<a class="btn hidden-xs lcb-upload-trigger" href="#">
<i class="fa fa-upload"></i>
</a>
</h2>
<div class="lcb-room-description">
<p>{{description}}</p>
</div>
Expand Down

0 comments on commit 8378aba

Please sign in to comment.