This commit is contained in:
Lalle 2023-04-16 21:48:44 +02:00
parent 67c9707175
commit bc41e49343
No known key found for this signature in database
GPG Key ID: A6583D207A8F6B0D

View File

@ -1,61 +0,0 @@
import Callbacks from '../classes/Callbacks'
import UI from '../General/UI'
import { g, Conf } from '../globals/globals'
import $ from '../platform/$'
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/main/docs/suggestions.md
*/
var Menu = {
init() {
if (!['index', 'thread'].includes(g.VIEW) || !Conf['Menu']) {
return
}
this.button = $.el('a', {
className: 'menu-button',
href: 'javascript:;',
})
$.extend(this.button, { innerHTML: '<i class="fa fa-angle-down"></i>' })
this.menu = new UI.Menu('post')
Callbacks.Post.push({
name: 'Menu',
cb: this.node,
})
return Callbacks.CatalogThread.push({
name: 'Menu',
cb: this.catalogNode,
})
},
node() {
if (this.isClone) {
const button = $('.menu-button', this.nodes.info)
$.rmClass(button, 'active')
$.rm($('.dialog', this.nodes.info))
Menu.makeButton(this, button)
return
}
return $.add(this.nodes.info, Menu.makeButton(this))
},
catalogNode() {
return $.after(this.nodes.icons, Menu.makeButton(this.thread.OP))
},
makeButton(post, button) {
if (!button) {
button = Menu.button.cloneNode(true)
}
$.on(button, 'click', function (e) {
return Menu.menu.toggle(e, this, post)
})
return button
},
}
export default Menu