Skip to content

Commit

Permalink
Merge pull request #417 from Pireax/account-menu-fix
Browse files Browse the repository at this point in the history
Fix account menu not working correctly on some mobile browsers
  • Loading branch information
datdamnzotz authored Jul 16, 2020
2 parents b74d631 + a5d9933 commit 1f70604
Showing 1 changed file with 6 additions and 7 deletions.
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

0 comments on commit 1f70604

Please sign in to comment.