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; top: 1px;
right: 1px; right: 1px;
} }
.catalog-thread > a:not(:hover) .menu-button {
display: none;
}
.thread-icons > .menu-button > i {
font-size: 14px;
}
.thread-stats { .thread-stats {
flex-shrink: 0; flex-shrink: 0;
cursor: help; cursor: help;

View File

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