Add the menu button to threads in the catalog.

Conflicts:
	src/Menu/Menu.coffee
This commit is contained in:
Mayhem 2014-02-02 23:30:04 +01:00 committed by ccd0
parent 8a0becd7bf
commit d0dd780d24
2 changed files with 26 additions and 10 deletions

View File

@ -540,6 +540,12 @@ hr ~ div.center:not(.ad-cnt) {
top: 1px;
right: 1px;
}
.catalog-thread > a:not(:hover) .menu-button {
display: none;
}
.thread-icons > .menu-button > i {
font-size: 14px;
}
.thread-stats {
flex-shrink: 0;
cursor: help;

View File

@ -2,10 +2,18 @@ Menu =
init: ->
return if g.VIEW is 'catalog' or !Conf['Menu']
@button = $.el 'a',
className: 'menu-button'
href: 'javascript:;'
$.extend @button, <%= html('<i class="fa fa-angle-down"></i>') %>
@menu = new UI.Menu 'post'
Post.callbacks.push
name: 'Menu'
cb: @node
CatalogThread.callbacks.push
name: 'Image Hover'
cb: @catalogNode
node: ->
if @isClone
@ -13,16 +21,18 @@ Menu =
return
$.add @nodes.info, Menu.makeButton()
makeButton: do ->
a = $.el 'a',
className: 'menu-button'
href: 'javascript:;'
$.extend a, <%= html('<i class="fa fa-angle-down"></i>') %>
->
button = a.cloneNode true
$.on button, 'click', Menu.toggle
button
catalogNode: ->
$.add @nodes.icons, Menu.makeButton()
makeButton: ->
clone = Menu.button.cloneNode true
$.on clone, 'click', Menu.toggle
clone
toggle: (e) ->
post = Get.postFromNode @
try
post = Get.postFromNode @
catch
fullID = @parentNode.parentNode.parentNode.dataset.fullID
post = g.threads[fullID].OP
Menu.menu.toggle e, @, post