Commit ebf06cae authored by csillag's avatar csillag

When hiding the view/sort controls, collapse the dropdown menu, too. Fixes #1215.

parent b80eef94
......@@ -157,6 +157,11 @@ class App
sort: ''
view: 'Screen'
$rootScope.collapseViewSortMenus = () ->
$(".viewsort .dropdown-toggle").toArray().forEach (toggle) ->
if $(toggle).parent().hasClass "open"
$(toggle).click()
# Show the sort/view control for a while.
#
# hide: should we hide it after a second?
......@@ -164,8 +169,12 @@ class App
$rootScope.showViewSort = (show = true, hide = false) ->
if _vstp then $timeout.cancel _vstp
$rootScope.viewState.showControls = show
$rootScope.collapseViewSortMenus() unless show
if $rootScope.viewState.showControls and hide
_vstp = $timeout (-> $rootScope.viewState.showControls = false), 1000
_vstp = $timeout (->
$rootScope.viewState.showControls = false
$rootScope.collapseViewSortMenus()
), 1000
# "View" -- which annotations are shown
$rootScope.applyView = (view) ->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment