Nuke toggling the header auto-hide by clicking on its border.

This commit is contained in:
Mayhem 2014-03-10 09:29:30 +01:00
parent e294721ad5
commit 3b183d7283
4 changed files with 9 additions and 25 deletions

View File

@ -1,3 +1,6 @@
- Clicking on the border of the Header will not toggle `Header auto-hide` anymore.
You can still change the setting in the Header menu → Header.
## 3.19.0 - *2014-02-22* ## 3.19.0 - *2014-02-22*
- Thread and post hiding changes: - Thread and post hiding changes:

View File

@ -159,26 +159,18 @@ a[href="javascript:;"] {
-webkit-transform: translateY(100%); -webkit-transform: translateY(100%);
transform: translateY(100%); transform: translateY(100%);
} }
#toggle-header-bar { #header-bar-hitzone {
left: 0; left: 0;
right: 0; right: 0;
height: 10px; height: 10px;
position: absolute; position: absolute;
} }
#header.top #toggle-header-bar { #header.top #header-bar-hitzone {
cursor: n-resize;
bottom: -10px; bottom: -10px;
} }
#header.bottom #toggle-header-bar { #header.bottom #header-bar-hitzone {
cursor: s-resize;
top: -10px; top: -10px;
} }
#header.top #header-bar.autohide #toggle-header-bar {
cursor: s-resize;
}
#header.bottom #header-bar.autohide #toggle-header-bar {
cursor: n-resize;
}
#header-bar a:not(.entry) { #header-bar a:not(.entry) {
text-decoration: none; text-decoration: none;
padding: 1px; padding: 1px;

View File

@ -4,6 +4,6 @@
<span id="custom-board-list"></span> <span id="custom-board-list"></span>
<span id="full-board-list" hidden></span> <span id="full-board-list" hidden></span>
</span> </span>
<div id="toggle-header-bar" title="Toggle the header auto-hiding."></div> <div id="header-bar-hitzone"></div>
</div> </div>
<div id="notifications"></div> <div id="notifications"></div>

View File

@ -5,7 +5,7 @@ Header =
innerHTML: <%= importHTML('General/Header') %> innerHTML: <%= importHTML('General/Header') %>
@bar = $ '#header-bar', headerEl @bar = $ '#header-bar', headerEl
@toggle = $ '#toggle-header-bar', @bar @toggle = $ '#header-bar-hitzone', @bar
@noticesRoot = $ '#notifications', headerEl @noticesRoot = $ '#notifications', headerEl
@menu = new UI.Menu 'header' @menu = new UI.Menu 'header'
@ -15,7 +15,6 @@ Header =
href: 'javascript:;' href: 'javascript:;'
$.on menuButton, 'click', @menuToggle $.on menuButton, 'click', @menuToggle
@addShortcut menuButton, 0 @addShortcut menuButton, 0
$.on @toggle, 'mousedown', @toggleBarVisibility
$.on window, 'load hashchange', Header.hashScroll $.on window, 'load hashchange', Header.hashScroll
$.on d, 'CreateNotification', @createNotification $.on d, 'CreateNotification', @createNotification
@ -178,22 +177,12 @@ Header =
setBarVisibility: (hide) -> setBarVisibility: (hide) ->
Header.headerToggler.checked = hide Header.headerToggler.checked = hide
$.event 'CloseMenu'
(if hide then $.addClass else $.rmClass) Header.bar, 'autohide' (if hide then $.addClass else $.rmClass) Header.bar, 'autohide'
toggleBarVisibility: (e) -> toggleBarVisibility: (e) ->
return if e.type is 'mousedown' and e.button isnt 0 # not LMB hide = @checked
hide = if @nodeName is 'INPUT'
@checked
else
!$.hasClass Header.bar, 'autohide'
Conf['Header auto-hide'] = hide Conf['Header auto-hide'] = hide
$.set 'Header auto-hide', hide $.set 'Header auto-hide', hide
Header.setBarVisibility hide Header.setBarVisibility hide
message = if hide
'The header bar will automatically hide itself.'
else
'The header bar will remain visible.'
new Notice 'info', message, 2
setHideBarOnScroll: (hide) -> setHideBarOnScroll: (hide) ->
Header.scrollHeaderToggler.checked = hide Header.scrollHeaderToggler.checked = hide