mirror of
https://github.com/szimek/sharedrop.git
synced 2026-06-13 21:03:07 +08:00
Add User view similar to Peer view, but without all file handling crap.
This commit is contained in:
parent
f5bbb46b8f
commit
abb153cd89
@ -40,6 +40,7 @@
|
||||
<script src="/scripts/app/models/peer.js"></script>
|
||||
<script src="/scripts/app/models/user.js"></script>
|
||||
<script src="/scripts/app/views/index_view.js"></script>
|
||||
<script src="/scripts/app/views/user_view.js"></script>
|
||||
<script src="/scripts/app/views/peer_view.js"></script>
|
||||
<script src="/scripts/app/views/file_field.js"></script>
|
||||
|
||||
|
||||
@ -6,6 +6,6 @@
|
||||
|
||||
{{#if user.uuid}}
|
||||
<div class="user you">
|
||||
{{render "peer" user}}
|
||||
{{render "user" user}}
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
@ -8,9 +8,6 @@ FileDrop.PeerView = Ember.View.extend(Ember.ViewTargetActionSupport, {
|
||||
var user = this.get('controller.controllers.index.user'),
|
||||
peer = this.get('controller.model');
|
||||
|
||||
// Can't send files to yourself.
|
||||
if (user.get('uuid') === peer.get('uuid')) return;
|
||||
|
||||
// Can't send files to disconnected user.
|
||||
if (!peer.get('isConnected')) return;
|
||||
|
||||
@ -35,9 +32,6 @@ FileDrop.PeerView = Ember.View.extend(Ember.ViewTargetActionSupport, {
|
||||
files = dt.files,
|
||||
file = files[0];
|
||||
|
||||
// Can't send files to yourself.
|
||||
if (user.get('uuid') === peer.get('uuid')) return;
|
||||
|
||||
// Can't send files to disconnected user.
|
||||
if (!peer.get('isConnected')) return;
|
||||
|
||||
|
||||
6
app/scripts/app/views/user_view.js
Normal file
6
app/scripts/app/views/user_view.js
Normal file
@ -0,0 +1,6 @@
|
||||
FileDrop.UserView = Ember.View.extend({
|
||||
templateName: 'peer',
|
||||
isConnected: Ember.computed.alias('controller.model.isConnected'),
|
||||
classNames: ['peer'],
|
||||
classNameBindings: ['isConnected:connected:disconnected']
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user