Browse code

Deaktivacia zmien mena, stavu a avatara, ak som prihlaseny cez FB

Cinan Rakosnik authored on 29/05/2013 at 16:24:03
Showing 2 changed files
... ...
@@ -6,8 +6,12 @@
6 6
       .background
7 7
       %p change
8 8
   %h1
9
-    %input{ type: 'text', title: "#{@jid}", class: 'js-edit-name', value: "#{@name}"}
10
-  %h2{style: 'margin-top: -5px'} #{@message || '<input type="text" class="js-edit-status empty" value="'+I18n.t('chat.roster.change_status_msg')+'">' }
9
+    %input{ type: 'text', title: "#{@jid}", class: 'js-edit-name', value: "#{@name}", disabled: @isFb ? 'disabled' : ''}
10
+  %h2{style: 'margin-top: -5px'}
11
+    -if @message
12
+      @message
13
+    -else
14
+      %input{ type: 'text', class: 'js-edit-status empty', value: I18n.t('chat.roster.change_status_msg'), disabled: @isFb ? 'disabled' : '' }
11 15
   %h3
12 16
     .rolldown.js-change-state
13 17
       .js-state-clickable{ 'data-state' => 'online' }
... ...
@@ -15,8 +15,8 @@ class Xmpp.Views.Contacts.MeView extends Backbone.View
15 15
     'click .js-state-clickable': (e) -> @confirmChangeState(e)
16 16
 
17 17
     #avatar change events:
18
-    'mouseover .avatar': -> $('.change-avatar').show()
19
-    'mouseout .avatar': -> $('.change-avatar').hide()
18
+    'mouseover .avatar': 'mouseoverAvatar'
19
+    'mouseout .avatar': 'mouseoutAvatar'
20 20
     'click .change-avatar': -> $('input[name=avatar]').click()
21 21
     'change input[name=avatar]': 'uploadAvatar'
22 22
 
... ...
@@ -35,6 +35,7 @@ class Xmpp.Views.Contacts.MeView extends Backbone.View
35 35
     this
36 36
 
37 37
   editTextInput: (e) ->
38
+    return false if App.Models.me.get('isFB')
38 39
     $this = $(e.currentTarget)
39 40
 
40 41
     if ($this.hasClass('empty'))
... ...
@@ -100,7 +101,17 @@ class Xmpp.Views.Contacts.MeView extends Backbone.View
100 100
 
101 101
     App.Com.updateMyStatus(@_getStatusMessage(), @_getState())
102 102
 
103
+  mouseoverAvatar: ->
104
+    return false if App.Models.me.get('isFB')
105
+    $('.change-avatar').show()
106
+
107
+  mouseoutAvatar: ->
108
+    return false if App.Models.me.get('isFB')
109
+    $('.change-avatar').hide()
110
+
103 111
   uploadAvatar: (e) ->
112
+    return false if App.Models.me.get('isFB')
113
+
104 114
     fr = new FileReader;
105 115
     fr.onloadend = ->
106 116
       App.Models.me.set(avatar: fr.result)