mirror of
https://github.com/LalleSX/4chan-XZ.git
synced 2026-01-30 09:48:12 +01:00
del js
This commit is contained in:
parent
67c9707175
commit
bc41e49343
@ -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
|
|
||||||
Loading…
x
Reference in New Issue
Block a user