From 2f2a398e132726f5212a2d37d1e6363be54f9da0 Mon Sep 17 00:00:00 2001 From: James Campos Date: Wed, 21 Sep 2011 23:07:06 -0700 Subject: [PATCH] make img clicking work for chrom --- 4chan_x.user.js | 12 +++++++----- script.coffee | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index abb4af952..4c5f0e2aa 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1259,12 +1259,12 @@ var box, file, files; files = $('#files', QR.qr); box = $.el('li', { - innerHTML: "click hereX" + innerHTML: "X" }); file = $('input', box); $.bind(file, 'change', QR.change); $.bind($('img', box), 'click', function() { - return this.nextSibling.click(); + return $('input', this.parentNode).click(); }); $.bind($('.x', box), 'click', QR.rmThumb); $.add(files, box); @@ -1336,7 +1336,7 @@ } qr = QR.qr; fr = new FileReader(); - img = this.previousSibling; + img = $('img', this.parentNode); fr.onload = function(e) { return img.src = e.target.result; }; @@ -3171,12 +3171,14 @@ https://bugs.webkit.org/show_bug.cgi?id=58208\ http://code.google.com/p/chromium/issues/detail?id=78961\ */\ - visibility: hidden;\ + font-size: 100px;\ + position: absolute;\ + left: 0;\ + opacity: 0;\ }\ #qr #files img {\ max-height: 100px;\ max-width: 100px;\ - float: left;\ }\ #qr input[name=resto] {\ width: 80px;\ diff --git a/script.coffee b/script.coffee index b548d5d85..f2b9988b1 100644 --- a/script.coffee +++ b/script.coffee @@ -973,10 +973,10 @@ QR = #$('#autopost', QR.qr).checked = true files = $ '#files', QR.qr box = $.el 'li', - innerHTML: "click hereX" + innerHTML: "X" file = $ 'input', box $.bind file, 'change', QR.change - $.bind $('img', box), 'click', -> @nextSibling.click() + $.bind $('img', box), 'click', -> $('input', @parentNode).click() $.bind $('.x', box), 'click', QR.rmThumb $.add files, box file.click() @@ -1028,7 +1028,7 @@ QR = return {qr} = QR fr = new FileReader() - img = @previousSibling + img = $ 'img', @parentNode fr.onload = (e) -> img.src = e.target.result fr.readAsDataURL file @@ -2501,12 +2501,14 @@ Main = https://bugs.webkit.org/show_bug.cgi?id=58208 http://code.google.com/p/chromium/issues/detail?id=78961 */ - visibility: hidden; + font-size: 100px; + position: absolute; + left: 0; + opacity: 0; } #qr #files img { max-height: 100px; max-width: 100px; - float: left; } #qr input[name=resto] { width: 80px;