Added small comments.

This commit is contained in:
Martin Edenhofer 2015-10-19 16:15:16 +02:00
parent 9ea7219463
commit 62367ce256

View file

@ -48,7 +48,7 @@ class App.User extends App.Model
avatar: (size = 40, placement = '', cssClass = '', unique = false, avatar, type = undefined) -> avatar: (size = 40, placement = '', cssClass = '', unique = false, avatar, type = undefined) ->
size = parseInt(size, 10) size = parseInt(size, 10)
cssClass += " " if cssClass cssClass += ' ' if cssClass
cssClass += "size-#{ size }" cssClass += "size-#{ size }"
if placement if placement
@ -65,6 +65,7 @@ class App.User extends App.Model
vip = false vip = false
data = " data-avatar-id=\"#{avatar.id}\"" data = " data-avatar-id=\"#{avatar.id}\""
# set vip flag, ignore if personal avatar is request
vip = @vip vip = @vip
if type is 'personal' if type is 'personal'
vip = false vip = false
@ -74,7 +75,9 @@ class App.User extends App.Model
# use system avatar for system actions # use system avatar for system actions
if @id is 1 if @id is 1
return App.view('avatar_system')() return App.view('avatar_system')()
else if !@image || @image is 'none' || unique
# generate uniq avatar
if !@image || @image is 'none' || unique
width = 300 width = 300
height = 226 height = 226
@ -90,13 +93,14 @@ class App.User extends App.Model
x: x x: x
y: y y: y
initials: @initials() initials: @initials()
else
return App.view('avatar') # generate image based avatar
data: data return App.view('avatar')
cssClass: cssClass data: data
placement: placement cssClass: cssClass
vip: vip placement: placement
url: @imageUrl() vip: vip
url: @imageUrl()
imageUrl: -> imageUrl: ->
return if !@image return if !@image