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. * Licensed under the MIT license.
* https://github.com/seaweedchan/4chan-x/blob/master/LICENSE * https://github.com/seaweedchan/4chan-x/blob/master/LICENSE

View File

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

View File

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

View File

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