Create buttons by cloning template. #2282
This commit is contained in:
parent
9697aa94f1
commit
937ed94771
@ -4,6 +4,7 @@ PostJumper =
|
|||||||
|
|
||||||
@capcode = Object.create(null)
|
@capcode = Object.create(null)
|
||||||
@uniqueID = Object.create(null)
|
@uniqueID = Object.create(null)
|
||||||
|
@buttons = @makeButtons()
|
||||||
|
|
||||||
Callbacks.Post.push
|
Callbacks.Post.push
|
||||||
name: 'Post Jumper'
|
name: 'Post Jumper'
|
||||||
@ -18,7 +19,7 @@ PostJumper =
|
|||||||
|
|
||||||
addButtons: (post,type) ->
|
addButtons: (post,type) ->
|
||||||
value = post.nodes[type].innerText
|
value = post.nodes[type].innerText
|
||||||
buttons = PostJumper.makeButtons type+'Jumper'
|
buttons = PostJumper.buttons.cloneNode(true)
|
||||||
$.after post.nodes[type+(if type is 'capcode' then '' else 'Root')], buttons
|
$.after post.nodes[type+(if type is 'capcode' then '' else 'Root')], buttons
|
||||||
$.on buttons.firstChild, 'click', PostJumper.buttonClick post,type,-1
|
$.on buttons.firstChild, 'click', PostJumper.buttonClick post,type,-1
|
||||||
$.on buttons.lastChild, 'click', PostJumper.buttonClick post,type,1
|
$.on buttons.lastChild, 'click', PostJumper.buttonClick post,type,1
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user