Skip to content

Commit 2bfc145

Browse files
authored
Merge pull request #372 from nud/fix-totoz-position
Fix overlay totoz positioning
2 parents d787c9f + 8c2e60d commit 2bfc145

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/assets/javascripts/chat.coffee

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ class Chat
144144
.css(display: "none", position: "absolute")
145145
.append("<img src=\"#{@totoz_url}#{totozName}\"/>")
146146
@totoz.append totoz
147-
offset = $(event.target).offset()
148-
[x, y] = [offset.left, offset.top]
149-
totoz.css "z-index": "15", display: "block", top: y + 20, left: x + 20
147+
position = $(event.target).position()
148+
[x, y] = [position.left, position.top + event.target.offsetHeight]
149+
totoz.css "z-index": "15", display: "block", top: y + 5, left: x + 5
150150

151151
destroyTotoz: (event) =>
152152
totozId = encodeURIComponent(event.target.getAttribute("data-totoz-name")).replace(/[%']/g, "")

0 commit comments

Comments
 (0)