Skip to content

Commit 5910305

Browse files
committed
Update code docs
1 parent 324abb0 commit 5910305

3 files changed

Lines changed: 33 additions & 15 deletions

File tree

docs/components_JROverhang.bs.html

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
m.logoPoster = createLogoPoster() ' save node to memory for faster load time
1010
m.title = m.top.findNode("title")
1111
m.user = m.top.findNode("username")
12-
m.userImage = m.top.findNode("userImage")
12+
m.userGroup = m.top.findNode("userGroup")
1313
m.clock = m.top.findNode("clock")
1414
m.slideDownAnimation = m.top.findNode("slideDown")
1515
m.slideUpAnimation = m.top.findNode("slideUp")
@@ -35,23 +35,41 @@
3535
sub currentUserChanged()
3636
m.user.text = m.top.currentUser
3737

38+
if not isValid(m.userImagePoster)
39+
m.userImagePoster = createUserImage()
40+
end if
41+
3842
if m.top.currentUser = ""
39-
m.userImage.uri = ""
40-
else
41-
imgParams = {
42-
maxHeight: 36,
43-
maxWidth: 36,
44-
quality: 90
45-
}
46-
imgTag = m.global.session.user.primaryImageTag
47-
if isValid(imgTag) and imgTag <> ""
48-
imgParams.tag = imgTag
43+
userImage = m.userGroup.findNode("userImage")
44+
if isValid(userImage)
45+
m.userGroup.removeChild(userImage)
4946
end if
50-
m.userImage.uri = buildURL(Substitute("/Users/{0}/Images/Primary", m.global.session.user.id), imgParams)
51-
47+
else
48+
m.userGroup.insertChild(m.userImagePoster, 0)
5249
end if
5350
end sub
5451

52+
function createUserImage() as object
53+
imgParams = {
54+
maxHeight: 36,
55+
maxWidth: 36,
56+
quality: 90
57+
}
58+
imgTag = m.global.session.user.primaryImageTag
59+
if isValid(imgTag) and imgTag <> ""
60+
imgParams.tag = imgTag
61+
end if
62+
63+
userImage = createObject("roSGNode", "Poster")
64+
userImage.id = "userImage"
65+
userImage.uri = buildURL(Substitute("/Users/{0}/Images/Primary", m.global.session.user.id))
66+
userImage.width = "36"
67+
userImage.height = "36"
68+
userImage.translation = "[0, -2]"
69+
70+
return userImage
71+
end function
72+
5573
' component boolean field isVisible has changed value
5674
sub isLogoVisibleChanged()
5775
if m.top.isLogoVisible

docs/data/search.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/module-JROverhang.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)