Add index refresh shortcut in the header bar.
Also fix lazy/lame implementation of Header.addShortcut()
This commit is contained in:
parent
66ebbd87f0
commit
c2984275e5
@ -257,11 +257,10 @@ Header =
|
||||
addShortcut: (el, index) ->
|
||||
shortcut = $.el 'span',
|
||||
className: 'shortcut'
|
||||
shortcut.dataset.index = index
|
||||
$.add shortcut, el
|
||||
shortcuts = $ '#shortcuts', Header.bar
|
||||
nodes = [shortcuts.childNodes...]
|
||||
nodes.splice index, 0, shortcut
|
||||
$.add shortcuts, nodes
|
||||
$.add shortcuts, [shortcuts.childNodes...].concat(shortcut).sort (a, b) -> a.dataset.index - b.dataset.index
|
||||
|
||||
menuToggle: (e) ->
|
||||
Header.menu.toggle e, @, g
|
||||
|
||||
@ -7,7 +7,7 @@ ImageExpand =
|
||||
title: 'Expand All Images'
|
||||
href: 'javascript:;'
|
||||
$.on @EAI, 'click', ImageExpand.cb.toggleAll
|
||||
Header.addShortcut @EAI, 2
|
||||
Header.addShortcut @EAI, 3
|
||||
|
||||
Post.callbacks.push
|
||||
name: 'Image Expansion'
|
||||
|
||||
@ -2,6 +2,13 @@ Index =
|
||||
init: ->
|
||||
return if g.VIEW isnt 'index'
|
||||
|
||||
button = $.el 'a',
|
||||
className: 'index-refresh-shortcut fa fa-refresh'
|
||||
title: 'Refresh Index'
|
||||
href: 'javascript:;'
|
||||
$.on button, 'click', Index.update
|
||||
Header.addShortcut button, 1
|
||||
|
||||
subEntries = []
|
||||
|
||||
subEntry =
|
||||
|
||||
@ -26,7 +26,7 @@ QR =
|
||||
$.event 'CloseMenu'
|
||||
QR.open()
|
||||
QR.nodes.com.focus()
|
||||
Header.addShortcut sc, 1
|
||||
Header.addShortcut sc, 2
|
||||
|
||||
$.on d, 'QRGetSelectedPost', ({detail: cb}) ->
|
||||
cb QR.selected
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user