Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix account menu not working correctly on some mobile browsers #417

Merged
merged 1 commit into from
Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/cljs/orcpub/dnd/e5/views.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,8 @@
(def user-menu-style
{:background-color menu-color
:z-index 10000
:position :fixed
:position :absolute
:right 0
:display :none})

(defn handle-user-menu [e]
Expand All @@ -194,8 +195,6 @@
right (.-right bounding-rect)
style (.-style user-menu)
window-width js/document.documentElement.clientWidth]
(set! (.-right style) (str (- window-width right) "px"))
(set! (.-top style) (str bottom "px"))
(set! (.-display style) "block")))

(defn hide-user-menu [e]
Expand All @@ -206,10 +205,9 @@
(defn user-header-view []
(let [username @(subscribe [:username])
mobile? @(subscribe [:mobile?])]
[:div#user-header.pointer
[:div#user-header.pointer.posn-rel
(if username
{:on-click hide-user-menu
:on-mouse-over handle-user-menu
{:on-mouse-over handle-user-menu
:on-mouse-out hide-user-menu})
[:div.flex.align-items-c
[:div.user-icon [svg-icon "orc-head" 40 ""]]
Expand All @@ -224,7 +222,8 @@
(if username
[:i.fa.m-l-5.fa-caret-down])]
[:div#user-menu.shadow.f-w-b
{:style user-menu-style}
{:style user-menu-style
:on-click hide-user-menu}
[:div.p-10.opacity-5.hover-opacity-full
{:on-click dispatch-logout}
"LOG OUT"]
Expand Down