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,12 +8287,17 @@
}, },
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 = null;
return function() {
var clone;
if (frag == null) {
frag = $.nodes([ frag = $.nodes([
$.tn(' '), $.el('a', { $.tn(' '), $.el('a', {
className: 'menu-button', className: 'menu-button',
@ -8300,8 +8305,7 @@
href: 'javascript:;' href: 'javascript:;'
}) })
]); ]);
return function() { }
var clone;
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,12 +8285,17 @@
}, },
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 = null;
return function() {
var clone;
if (frag == null) {
frag = $.nodes([ frag = $.nodes([
$.tn(' '), $.el('a', { $.tn(' '), $.el('a', {
className: 'menu-button', className: 'menu-button',
@ -8298,8 +8303,7 @@
href: 'javascript:;' href: 'javascript:;'
}) })
]); ]);
return function() { }
var clone;
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,10 +8,15 @@ 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 = null
->
unless frag?
frag = $.nodes [ frag = $.nodes [
$.tn(' ') $.tn(' ')
$.el 'a', $.el 'a',
@ -19,7 +24,6 @@ Menu =
innerHTML: '[<i></i>]' innerHTML: '[<i></i>]'
href: 'javascript:;' href: 'javascript:;'
] ]
->
clone = frag.cloneNode true clone = frag.cloneNode true
$.on clone.lastElementChild, 'click', Menu.toggle $.on clone.lastElementChild, 'click', Menu.toggle
clone clone