Imma take a chance to make our toggles better.
This commit is contained in:
parent
66e44097f7
commit
56313213d1
File diff suppressed because one or more lines are too long
@ -148,8 +148,9 @@ a[href="javascript:;"] {
|
||||
.brackets-wrap::after {
|
||||
content: "]\\00a0";
|
||||
}
|
||||
.disabled,
|
||||
.expand-all-shortcut {
|
||||
opacity: .35;
|
||||
opacity: .45;
|
||||
}
|
||||
|
||||
/* Notifications */
|
||||
|
||||
@ -122,7 +122,9 @@ CatalogLinks =
|
||||
el = $.el 'a',
|
||||
id: 'toggleCatalog'
|
||||
href: 'javascript:;'
|
||||
textContent: 'Catalog Off'
|
||||
className: if Conf['Header catalog links'] then 'disabled' else ''
|
||||
textContent: 'Catalog'
|
||||
title: "Turn catalog links #{if Conf['Header catalog links'] then 'off' else 'on'}."
|
||||
$.on el, 'click', @toggle
|
||||
|
||||
Header.addShortcut el
|
||||
@ -133,13 +135,11 @@ CatalogLinks =
|
||||
# it might be incomplete otherwise.
|
||||
$.asap (-> $.id 'boardNavMobile'), ->
|
||||
# Set links on load.
|
||||
CatalogLinks.toggle.call el, true
|
||||
CatalogLinks.toggle.call el
|
||||
|
||||
toggle: (onLoad) ->
|
||||
if onLoad is true
|
||||
useCatalog = $.get 'CatalogIsToggled', g.VIEW is 'catalog'
|
||||
else
|
||||
$.set 'CatalogIsToggled', useCatalog = @textContent is 'Catalog Off'
|
||||
toggle: ->
|
||||
$.set 'Header catalog links', useCatalog = @className is 'disabled'
|
||||
$.toggleClass @, 'disabled'
|
||||
for a in $$ 'a', $.id('boardNavDesktop')
|
||||
board = a.pathname.split('/')[1]
|
||||
continue if ['f', 'status', '4chan'].contains(board) or !board
|
||||
@ -151,7 +151,6 @@ CatalogLinks =
|
||||
else
|
||||
a.pathname = "/#{board}/#{if useCatalog then 'catalog' else ''}"
|
||||
a.title = if useCatalog then "#{a.title} - Catalog" else a.title.replace(/\ -\ Catalog$/, '')
|
||||
@textContent = "Catalog #{if useCatalog then 'On' else 'Off'}"
|
||||
@title = "Turn catalog links #{if useCatalog then 'off' else 'on'}."
|
||||
|
||||
external: (board) ->
|
||||
|
||||
@ -19,15 +19,19 @@ QR =
|
||||
$.addClass doc, 'hide-original-post-form'
|
||||
|
||||
sc = $.el 'a',
|
||||
className: 'qr-shortcut'
|
||||
className: "qr-shortcut #{unless Conf['Persistent QR'] then 'disabled' else ''}"
|
||||
textContent: 'QR'
|
||||
title: 'Quick Reply'
|
||||
href: 'javascript:;'
|
||||
$.on sc, 'click', ->
|
||||
$.event 'CloseMenu'
|
||||
QR.open()
|
||||
QR.resetThreadSelector()
|
||||
QR.nodes.com.focus()
|
||||
if !QR.nodes or QR.nodes.el.hidden
|
||||
QR.open()
|
||||
QR.nodes.com.focus()
|
||||
QR.resetThreadSelector()
|
||||
else
|
||||
QR.close()
|
||||
$.toggleClass @, 'disabled'
|
||||
|
||||
Header.addShortcut sc
|
||||
|
||||
if $.engine is 'webkit'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user