remove callback from AddMenuEntry
This commit is contained in:
parent
94d44bf7ba
commit
c4c2f59161
@ -29,7 +29,10 @@ UI = do ->
|
|||||||
|
|
||||||
constructor: (@type) ->
|
constructor: (@type) ->
|
||||||
# Doc here: https://github.com/MayhemYDG/4chan-x/wiki/Menu-API
|
# Doc here: https://github.com/MayhemYDG/4chan-x/wiki/Menu-API
|
||||||
$.on d, 'AddMenuEntry', ({detail}) => @addEntry detail
|
$.on d, 'AddMenuEntry', ({detail}) =>
|
||||||
|
return if detail.type isnt @type
|
||||||
|
delete detail.open
|
||||||
|
@addEntry detail
|
||||||
@entries = []
|
@entries = []
|
||||||
menus[@type] = @
|
menus[@type] = @
|
||||||
|
|
||||||
@ -194,12 +197,10 @@ UI = do ->
|
|||||||
style.right = right
|
style.right = right
|
||||||
|
|
||||||
addEntry: (entry) =>
|
addEntry: (entry) =>
|
||||||
return if entry.type isnt @type
|
|
||||||
@parseEntry entry
|
@parseEntry entry
|
||||||
@entries.push entry
|
@entries.push entry
|
||||||
|
|
||||||
rmEntry: (entry) =>
|
rmEntry: (entry) =>
|
||||||
return if entry.type isnt @type
|
|
||||||
index = @entries.indexOf entry
|
index = @entries.indexOf entry
|
||||||
@entries.splice index, 1
|
@entries.splice index, 1
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user