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