From 22f5597e6f771abbbf74f07d27d06df53d5968cd Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 7 Sep 2011 17:18:54 -0700 Subject: [PATCH] horizontal scrolling --- 4chan_x.user.js | 20 ++++++++++++++------ script.coffee | 18 +++++++++++++----- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 1c48475f0..3a05394c7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1259,20 +1259,20 @@ } }, attach: function() { - var div, file, files; + var box, file, files; files = $('#files', QR.qr); - div = $.el('div', { + box = $.el('span', { innerHTML: "click hereX" }); - file = $('input', div); + file = $('input', box); $.bind(file, 'change', QR.change); - $.bind($('img', div), 'click', function() { + $.bind($('img', box), 'click', function() { return this.previousSibling.click(); }); - $.bind($('.x', div), 'click', function() { + $.bind($('.x', box), 'click', function() { return $.rm(this.parentNode); }); - $.add(files, div); + $.add(files, box); return file.click(); }, captchaNode: function(e) { @@ -3132,6 +3132,14 @@ #qr #captcha {\ position: relative;\ }\ + #qr #files {\ + width: 300px;\ + white-space: nowrap;\ + overflow: auto;\ + }\ + #qr #files span {\ + position: relative;\ + }\ #qr #files a {\ position: absolute;\ left: 0;\ diff --git a/script.coffee b/script.coffee index 0ac5948f5..5fa4186cc 100644 --- a/script.coffee +++ b/script.coffee @@ -969,13 +969,13 @@ QR = attach: -> #$('#autopost', QR.qr).checked = true files = $ '#files', QR.qr - div = $.el 'div', + box = $.el 'span', innerHTML: "click hereX" - file = $ 'input', div + file = $ 'input', box $.bind file, 'change', QR.change - $.bind $('img', div), 'click', -> @previousSibling.click() - $.bind $('.x', div), 'click', -> $.rm @parentNode - $.add files, div + $.bind $('img', box), 'click', -> @previousSibling.click() + $.bind $('.x', box), 'click', -> $.rm @parentNode + $.add files, box file.click() captchaNode: (e) -> QR.captcha = @@ -2449,6 +2449,14 @@ main = #qr #captcha { position: relative; } + #qr #files { + width: 300px; + white-space: nowrap; + overflow: auto; + } + #qr #files span { + position: relative; + } #qr #files a { position: absolute; left: 0;