fix autohide

This commit is contained in:
James Campos 2011-03-12 08:09:37 -08:00
parent a43b5d79f3
commit f658e7baab
2 changed files with 8 additions and 4 deletions

View File

@ -331,7 +331,7 @@
var klass, qr; var klass, qr;
qr = $('#qr'); qr = $('#qr');
klass = qr.className; klass = qr.className;
if (klass.indexOf('auto') === -1) { if (this.checked) {
klass += ' auto'; klass += ' auto';
} else { } else {
klass = klass.replace(' auto', ''); klass = klass.replace(' auto', '');
@ -928,6 +928,7 @@
if (!(qr = $('#qr'))) { if (!(qr = $('#qr'))) {
html = "<div class=move>Quick Reply <input type=checkbox title=autohide><a name=close title=close>X</a></div>"; html = "<div class=move>Quick Reply <input type=checkbox title=autohide><a name=close title=close>X</a></div>";
qr = new Dialog('qr', 'topleft', html).el; qr = new Dialog('qr', 'topleft', html).el;
$('input[title=autohide]', qr).addEventListener('click', autohide, true);
form = $('form[name=post]'); form = $('form[name=post]');
clone = form.cloneNode(true); clone = form.cloneNode(true);
_ref = $$('script', clone); _ref = $$('script', clone);
@ -963,6 +964,7 @@
} }
mv(clone, qr); mv(clone, qr);
mv(qr, d.body); mv(qr, d.body);
qr.style.width = qr.offsetWidth;
} }
if ((_ref2 = $('input[title=autohide]:checked', qr)) != null) { if ((_ref2 = $('input[title=autohide]:checked', qr)) != null) {
_ref2.click(); _ref2.click();
@ -1455,7 +1457,7 @@
color: red;\ color: red;\
}\ }\
#qr.auto:not(:hover) form {\ #qr.auto:not(:hover) form {\
visibility: collapse;\ display: none;\
}\ }\
#qr span.error {\ #qr span.error {\
position: absolute;\ position: absolute;\

View File

@ -192,7 +192,7 @@ zeroPad = (n) ->
autohide = -> autohide = ->
qr = $ '#qr' qr = $ '#qr'
klass = qr.className klass = qr.className
if klass.indexOf('auto') is -1 if @checked
klass += ' auto' klass += ' auto'
else else
klass = klass.replace(' auto', '') klass = klass.replace(' auto', '')
@ -668,6 +668,7 @@ quickReply = (link, text) ->
unless qr = $ '#qr' unless qr = $ '#qr'
html = "<div class=move>Quick Reply <input type=checkbox title=autohide><a name=close title=close>X</a></div>" html = "<div class=move>Quick Reply <input type=checkbox title=autohide><a name=close title=close>X</a></div>"
qr = new Dialog('qr', 'topleft', html).el qr = new Dialog('qr', 'topleft', html).el
$('input[title=autohide]', qr).addEventListener 'click', autohide, true
form = $ 'form[name=post]' form = $ 'form[name=post]'
clone = form.cloneNode true clone = form.cloneNode true
@ -697,6 +698,7 @@ quickReply = (link, text) ->
inBefore submit, auto inBefore submit, auto
mv clone, qr mv clone, qr
mv qr, d.body mv qr, d.body
qr.style.width = qr.offsetWidth
$('input[title=autohide]:checked', qr)?.click() $('input[title=autohide]:checked', qr)?.click()
textarea = $('textarea', qr) textarea = $('textarea', qr)
@ -1100,7 +1102,7 @@ GM_addStyle '
color: red; color: red;
} }
#qr.auto:not(:hover) form { #qr.auto:not(:hover) form {
visibility: collapse; display: none;
} }
#qr span.error { #qr span.error {
position: absolute; position: absolute;