From 571ca1f9b90a0adb1fd826f7091f69b345fbd0bf Mon Sep 17 00:00:00 2001 From: James Campos Date: Fri, 2 Sep 2011 21:04:11 -0700 Subject: [PATCH] auto attach --- 4chan_x.user.js | 8 +++++--- script.coffee | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index bf2e3b889..4941abc38 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1251,15 +1251,17 @@ } }, attach: function() { - var div; + var div, file; div = $.el('div', { innerHTML: 'X' }); - $.bind($('input', div), 'change', QR.change); + file = $('input', div); + $.bind(file, 'change', QR.change); $.bind($('a', div), 'click', function() { return $.rm(this.parentNode); }); - return $.append($('#files', QR.el), div); + $.append($('#files', QR.el), div); + return file.click(); }, autoPost: function() { if (!QR.hasContent()) { diff --git a/script.coffee b/script.coffee index b147b296d..140e730d3 100644 --- a/script.coffee +++ b/script.coffee @@ -982,9 +982,11 @@ QR = attach: -> div = $.el 'div', innerHTML: 'X' - $.bind $('input', div), 'change', QR.change + file = $ 'input', div + $.bind file, 'change', QR.change $.bind $('a', div), 'click', -> $.rm @parentNode $.append $('#files', QR.el), div + file.click() autoPost: -> return unless QR.hasContent() QR.submit()