Show the alt/shift+click shortcuts to watch/hide threads in the catalog thread menu.

This commit is contained in:
ccd0 2015-11-22 02:38:36 -08:00
parent 4f5b06c5ec
commit bd1babd898
3 changed files with 24 additions and 8 deletions

View File

@ -146,14 +146,17 @@ Index =
return if g.VIEW isnt 'index' or !Conf['JSON Navigation'] or !Conf['Menu'] or !Conf['Thread Hiding Link'] or g.BOARD.ID is 'f'
Menu.menu.addEntry
el: $.el 'a', href: 'javascript:;'
el: $.el 'a',
href: 'javascript:;'
className: 'has-shortcut-text'
, <%= html('<span></span><span class="shortcut-text">Shift+click</span>') %>
order: 20
open: ({thread}) ->
return false if Conf['Index Mode'] isnt 'catalog'
@el.textContent = if thread.isHidden
'Unhide thread'
@el.firstElementChild.textContent = if thread.isHidden
'Unhide'
else
'Hide thread'
'Hide'
$.off @el, 'click', @cb if @cb
@cb = ->
$.event 'CloseMenu'

View File

@ -42,14 +42,17 @@ ThreadWatcher =
if g.VIEW is 'index' and Conf['JSON Navigation'] and Conf['Menu'] and g.BOARD.ID isnt 'f'
Menu.menu.addEntry
el: $.el 'a', href: 'javascript:;'
el: $.el 'a',
href: 'javascript:;'
className: 'has-shortcut-text'
, <%= html('<span></span><span class="shortcut-text">Alt+click</span>') %>
order: 6
open: ({thread}) ->
return false if Conf['Index Mode'] isnt 'catalog'
@el.textContent = if ThreadWatcher.isWatched thread
'Unwatch thread'
@el.firstElementChild.textContent = if ThreadWatcher.isWatched thread
'Unwatch'
else
'Watch thread'
'Watch'
$.off @el, 'click', @cb if @cb
@cb = ->
$.event 'CloseMenu'

View File

@ -1703,6 +1703,16 @@ a:only-of-type > .remove {
position: relative;
top: 2px;
}
.entry.has-shortcut-text {
display: flex;
justify-content: space-between;
align-items: center;
}
.entry .shortcut-text {
opacity: 0.5;
font-size: 70%;
margin-left: 5px;
}
.has-submenu::after {
content: "";
border-left: .5em solid;