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) ->
|
addShortcut: (el, index) ->
|
||||||
shortcut = $.el 'span',
|
shortcut = $.el 'span',
|
||||||
className: 'shortcut'
|
className: 'shortcut'
|
||||||
|
shortcut.dataset.index = index
|
||||||
$.add shortcut, el
|
$.add shortcut, el
|
||||||
shortcuts = $ '#shortcuts', Header.bar
|
shortcuts = $ '#shortcuts', Header.bar
|
||||||
nodes = [shortcuts.childNodes...]
|
$.add shortcuts, [shortcuts.childNodes...].concat(shortcut).sort (a, b) -> a.dataset.index - b.dataset.index
|
||||||
nodes.splice index, 0, shortcut
|
|
||||||
$.add shortcuts, nodes
|
|
||||||
|
|
||||||
menuToggle: (e) ->
|
menuToggle: (e) ->
|
||||||
Header.menu.toggle e, @, g
|
Header.menu.toggle e, @, g
|
||||||
|
|||||||
@ -7,7 +7,7 @@ ImageExpand =
|
|||||||
title: 'Expand All Images'
|
title: 'Expand All Images'
|
||||||
href: 'javascript:;'
|
href: 'javascript:;'
|
||||||
$.on @EAI, 'click', ImageExpand.cb.toggleAll
|
$.on @EAI, 'click', ImageExpand.cb.toggleAll
|
||||||
Header.addShortcut @EAI, 2
|
Header.addShortcut @EAI, 3
|
||||||
|
|
||||||
Post.callbacks.push
|
Post.callbacks.push
|
||||||
name: 'Image Expansion'
|
name: 'Image Expansion'
|
||||||
|
|||||||
@ -2,6 +2,13 @@ Index =
|
|||||||
init: ->
|
init: ->
|
||||||
return if g.VIEW isnt 'index'
|
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 = []
|
subEntries = []
|
||||||
|
|
||||||
subEntry =
|
subEntry =
|
||||||
|
|||||||
@ -26,7 +26,7 @@ QR =
|
|||||||
$.event 'CloseMenu'
|
$.event 'CloseMenu'
|
||||||
QR.open()
|
QR.open()
|
||||||
QR.nodes.com.focus()
|
QR.nodes.com.focus()
|
||||||
Header.addShortcut sc, 1
|
Header.addShortcut sc, 2
|
||||||
|
|
||||||
$.on d, 'QRGetSelectedPost', ({detail: cb}) ->
|
$.on d, 'QRGetSelectedPost', ({detail: cb}) ->
|
||||||
cb QR.selected
|
cb QR.selected
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user