Add ordering to menu entries, using a flexbox layout.
This commit is contained in:
parent
859c5db1f0
commit
4f28b6d2e5
File diff suppressed because one or more lines are too long
@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
:root.burichan .entry:not(:last-child) {
|
:root.burichan .entry {
|
||||||
border-bottom: 1px solid #B7C5D9;
|
border-bottom: 1px solid #B7C5D9;
|
||||||
}
|
}
|
||||||
:root.burichan .focused.entry {
|
:root.burichan .focused.entry {
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
:root.futaba .entry:not(:last-child) {
|
:root.futaba .entry {
|
||||||
border-bottom: 1px solid #D9BFB7;
|
border-bottom: 1px solid #D9BFB7;
|
||||||
}
|
}
|
||||||
:root.futaba .focused.entry {
|
:root.futaba .focused.entry {
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
:root.photon .entry:not(:last-child) {
|
:root.photon .entry {
|
||||||
border-bottom: 1px solid #CCC;
|
border-bottom: 1px solid #CCC;
|
||||||
}
|
}
|
||||||
:root.photon .focused.entry {
|
:root.photon .focused.entry {
|
||||||
|
|||||||
@ -493,12 +493,16 @@ a[href="javascript:;"] {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
#menu {
|
#menu {
|
||||||
|
border-width: 1px 1px 0;
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-webkit-flex-flow: column nowrap;
|
||||||
|
flex-flow: column nowrap;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
outline: none;
|
outline: none;
|
||||||
}
|
}
|
||||||
.entry {
|
.entry {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
display: block;
|
|
||||||
outline: none;
|
outline: none;
|
||||||
padding: 3px 7px;
|
padding: 3px 7px;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -522,6 +526,10 @@ a[href="javascript:;"] {
|
|||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
.submenu {
|
.submenu {
|
||||||
|
display: -webkit-flex;
|
||||||
|
display: flex;
|
||||||
|
-webkit-flex-flow: column nowrap;
|
||||||
|
flex-flow: column nowrap;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
margin: -1px 0;
|
margin: -1px 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
:root.tomorrow .entry:not(:last-child) {
|
:root.tomorrow .entry {
|
||||||
border-bottom: 1px solid #111;
|
border-bottom: 1px solid #111;
|
||||||
}
|
}
|
||||||
:root.tomorrow .focused.entry {
|
:root.tomorrow .focused.entry {
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
:root.yotsuba-b .entry:not(:last-child) {
|
:root.yotsuba-b .entry {
|
||||||
border-bottom: 1px solid #B7C5D9;
|
border-bottom: 1px solid #B7C5D9;
|
||||||
}
|
}
|
||||||
:root.yotsuba-b .focused.entry {
|
:root.yotsuba-b .focused.entry {
|
||||||
|
|||||||
@ -28,7 +28,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Menu */
|
/* Menu */
|
||||||
:root.yotsuba .entry:not(:last-child) {
|
:root.yotsuba .entry {
|
||||||
border-bottom: 1px solid #D9BFB7;
|
border-bottom: 1px solid #D9BFB7;
|
||||||
}
|
}
|
||||||
:root.yotsuba .focused.entry {
|
:root.yotsuba .focused.entry {
|
||||||
|
|||||||
@ -174,6 +174,8 @@ UI = (->
|
|||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
@focus el
|
@focus el
|
||||||
).bind @
|
).bind @
|
||||||
|
{style} = el
|
||||||
|
style.webkitOrder = style.order = entry.order or 100
|
||||||
return unless subEntries
|
return unless subEntries
|
||||||
$.addClass el, 'has-submenu'
|
$.addClass el, 'has-submenu'
|
||||||
for subEntry in subEntries
|
for subEntry in subEntries
|
||||||
|
|||||||
@ -108,6 +108,7 @@ Settings =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'header'
|
type: 'header'
|
||||||
el: link
|
el: link
|
||||||
|
order: 100
|
||||||
|
|
||||||
# 4chan settings link
|
# 4chan settings link
|
||||||
link = $.el 'a',
|
link = $.el 'a',
|
||||||
@ -118,6 +119,7 @@ Settings =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'header'
|
type: 'header'
|
||||||
el: link
|
el: link
|
||||||
|
order: 101
|
||||||
open: -> !Conf['Disable 4chan\'s extension']
|
open: -> !Conf['Disable 4chan\'s extension']
|
||||||
|
|
||||||
return unless Conf['Disable 4chan\'s extension']
|
return unless Conf['Disable 4chan\'s extension']
|
||||||
@ -308,6 +310,7 @@ Filter =
|
|||||||
entry =
|
entry =
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: div
|
el: div
|
||||||
|
order: 50
|
||||||
open: (post) ->
|
open: (post) ->
|
||||||
Filter.menu.post = post
|
Filter.menu.post = post
|
||||||
true
|
true
|
||||||
@ -485,6 +488,7 @@ ThreadHiding =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: div
|
el: div
|
||||||
|
order: 20
|
||||||
open: ({thread, isReply}) ->
|
open: ({thread, isReply}) ->
|
||||||
if isReply or thread.isHidden
|
if isReply or thread.isHidden
|
||||||
return false
|
return false
|
||||||
@ -637,6 +641,7 @@ ReplyHiding =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: div
|
el: div
|
||||||
|
order: 20
|
||||||
open: (post) ->
|
open: (post) ->
|
||||||
if !post.isReply or post.isClone
|
if !post.isReply or post.isClone
|
||||||
return false
|
return false
|
||||||
@ -806,6 +811,7 @@ ReportLink =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: a
|
el: a
|
||||||
|
order: 10
|
||||||
open: (post) ->
|
open: (post) ->
|
||||||
ReportLink.post = post
|
ReportLink.post = post
|
||||||
!post.isDead
|
!post.isDead
|
||||||
@ -846,6 +852,7 @@ DeleteLink =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: div
|
el: div
|
||||||
|
order: 40
|
||||||
open: (post) ->
|
open: (post) ->
|
||||||
return false if post.isDead
|
return false if post.isDead
|
||||||
DeleteLink.post = post
|
DeleteLink.post = post
|
||||||
@ -935,6 +942,7 @@ DownloadLink =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: a
|
el: a
|
||||||
|
order: 70
|
||||||
open: ({file}) ->
|
open: ({file}) ->
|
||||||
return false unless file
|
return false unless file
|
||||||
a.href = file.URL
|
a.href = file.URL
|
||||||
@ -951,6 +959,7 @@ ArchiveLink =
|
|||||||
entry =
|
entry =
|
||||||
type: 'post'
|
type: 'post'
|
||||||
el: div
|
el: div
|
||||||
|
order: 90
|
||||||
open: ({ID: postID, thread: threadID, board}) ->
|
open: ({ID: postID, thread: threadID, board}) ->
|
||||||
redirect = Redirect.to {postID, threadID, board}
|
redirect = Redirect.to {postID, threadID, board}
|
||||||
redirect isnt "//boards.4chan.org/#{board}/"
|
redirect isnt "//boards.4chan.org/#{board}/"
|
||||||
|
|||||||
@ -23,6 +23,7 @@ QR =
|
|||||||
$.event 'AddMenuEntry',
|
$.event 'AddMenuEntry',
|
||||||
type: 'header'
|
type: 'header'
|
||||||
el: link
|
el: link
|
||||||
|
order: 10
|
||||||
|
|
||||||
$.on d, 'dragover', QR.dragOver
|
$.on d, 'dragover', QR.dragOver
|
||||||
$.on d, 'drop', QR.dropFile
|
$.on d, 'drop', QR.dropFile
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user