diff --git a/4chan_x.js b/4chan_x.js index 2bb5fc9a5..35f48e7f6 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -331,7 +331,7 @@ var klass, qr; qr = $('#qr'); klass = qr.className; - if (klass.indexOf('auto') === -1) { + if (this.checked) { klass += ' auto'; } else { klass = klass.replace(' auto', ''); @@ -928,6 +928,7 @@ if (!(qr = $('#qr'))) { html = "
Quick Reply X
"; qr = new Dialog('qr', 'topleft', html).el; + $('input[title=autohide]', qr).addEventListener('click', autohide, true); form = $('form[name=post]'); clone = form.cloneNode(true); _ref = $$('script', clone); @@ -963,6 +964,7 @@ } mv(clone, qr); mv(qr, d.body); + qr.style.width = qr.offsetWidth; } if ((_ref2 = $('input[title=autohide]:checked', qr)) != null) { _ref2.click(); @@ -1455,7 +1457,7 @@ color: red;\ }\ #qr.auto:not(:hover) form {\ - visibility: collapse;\ + display: none;\ }\ #qr span.error {\ position: absolute;\ diff --git a/script.coffee b/script.coffee index 52df58683..7597296f0 100644 --- a/script.coffee +++ b/script.coffee @@ -192,7 +192,7 @@ zeroPad = (n) -> autohide = -> qr = $ '#qr' klass = qr.className - if klass.indexOf('auto') is -1 + if @checked klass += ' auto' else klass = klass.replace(' auto', '') @@ -668,6 +668,7 @@ quickReply = (link, text) -> unless qr = $ '#qr' html = "
Quick Reply X
" qr = new Dialog('qr', 'topleft', html).el + $('input[title=autohide]', qr).addEventListener 'click', autohide, true form = $ 'form[name=post]' clone = form.cloneNode true @@ -697,6 +698,7 @@ quickReply = (link, text) -> inBefore submit, auto mv clone, qr mv qr, d.body + qr.style.width = qr.offsetWidth $('input[title=autohide]:checked', qr)?.click() textarea = $('textarea', qr) @@ -1100,7 +1102,7 @@ GM_addStyle ' color: red; } #qr.auto:not(:hover) form { - visibility: collapse; + display: none; } #qr span.error { position: absolute;