Added small comments.
This commit is contained in:
parent
9ea7219463
commit
62367ce256
1 changed files with 13 additions and 9 deletions
|
@ -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,7 +93,8 @@ class App.User extends App.Model
|
||||||
x: x
|
x: x
|
||||||
y: y
|
y: y
|
||||||
initials: @initials()
|
initials: @initials()
|
||||||
else
|
|
||||||
|
# generate image based avatar
|
||||||
return App.view('avatar')
|
return App.view('avatar')
|
||||||
data: data
|
data: data
|
||||||
cssClass: cssClass
|
cssClass: cssClass
|
||||||
|
|
Loading…
Reference in a new issue