This commit is contained in:
Zixaphir 2013-12-27 15:40:21 -07:00
parent a51e1455f7
commit 43751a00b8
4 changed files with 39 additions and 27 deletions

View File

@ -1,5 +1,5 @@
/*
* 4chan X - Version 1.2.44 - 2013-12-26
* 4chan X - Version 1.2.44 - 2013-12-27
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

@ -22,7 +22,7 @@
// ==/UserScript==
/*
* 4chan X - Version 1.2.44 - 2013-12-26
* 4chan X - Version 1.2.44 - 2013-12-27
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -8287,21 +8287,25 @@
},
node: function() {
if (this.isClone) {
return $.on($('.menu-button', this.nodes.info), 'click', Menu.toggle);
$.on($('.menu-button', this.nodes.info), 'click', Menu.toggle);
return;
}
return $.add(this.nodes.info, Menu.makeButton());
},
makeButton: (function() {
var frag;
frag = $.nodes([
$.tn(' '), $.el('a', {
className: 'menu-button',
innerHTML: '[<i></i>]',
href: 'javascript:;'
})
]);
frag = null;
return function() {
var clone;
if (frag == null) {
frag = $.nodes([
$.tn(' '), $.el('a', {
className: 'menu-button',
innerHTML: '[<i></i>]',
href: 'javascript:;'
})
]);
}
clone = frag.cloneNode(true);
$.on(clone.lastElementChild, 'click', Menu.toggle);
return clone;

View File

@ -1,6 +1,6 @@
// Generated by CoffeeScript
/*
* 4chan X - Version 1.2.44 - 2013-12-26
* 4chan X - Version 1.2.44 - 2013-12-27
*
* Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE
@ -8285,21 +8285,25 @@
},
node: function() {
if (this.isClone) {
return $.on($('.menu-button', this.nodes.info), 'click', Menu.toggle);
$.on($('.menu-button', this.nodes.info), 'click', Menu.toggle);
return;
}
return $.add(this.nodes.info, Menu.makeButton());
},
makeButton: (function() {
var frag;
frag = $.nodes([
$.tn(' '), $.el('a', {
className: 'menu-button',
innerHTML: '[<i></i>]',
href: 'javascript:;'
})
]);
frag = null;
return function() {
var clone;
if (frag == null) {
frag = $.nodes([
$.tn(' '), $.el('a', {
className: 'menu-button',
innerHTML: '[<i></i>]',
href: 'javascript:;'
})
]);
}
clone = frag.cloneNode(true);
$.on(clone.lastElementChild, 'click', Menu.toggle);
return clone;

View File

@ -8,18 +8,22 @@ Menu =
cb: @node
node: ->
return $.on $('.menu-button', @nodes.info), 'click', Menu.toggle if @isClone
if @isClone
$.on $('.menu-button', @nodes.info), 'click', Menu.toggle
return
$.add @nodes.info, Menu.makeButton()
makeButton: do ->
frag = $.nodes [
$.tn(' ')
$.el 'a',
className: 'menu-button'
innerHTML: '[<i></i>]'
href: 'javascript:;'
]
frag = null
->
unless frag?
frag = $.nodes [
$.tn(' ')
$.el 'a',
className: 'menu-button'
innerHTML: '[<i></i>]'
href: 'javascript:;'
]
clone = frag.cloneNode true
$.on clone.lastElementChild, 'click', Menu.toggle
clone