unless -> if / else

This commit is contained in:
James Campos 2011-04-07 15:19:49 -07:00
parent b4d078a1f1
commit 3862aeae56
2 changed files with 6 additions and 4 deletions

View File

@ -1106,10 +1106,11 @@
var dialog, id, s, selection, selectionID, ta, target, text, _ref; var dialog, id, s, selection, selectionID, ta, target, text, _ref;
e.preventDefault(); e.preventDefault();
target = e.target; target = e.target;
if (!(dialog = $('#qr'))) { if (dialog = $('#qr')) {
qr.autohide.unset();
} else {
dialog = qr.dialog(target); dialog = qr.dialog(target);
} }
qr.autohide.unset();
id = target.textContent; id = target.textContent;
text = ">>" + id + "\n"; text = ">>" + id + "\n";
selection = window.getSelection(); selection = window.getSelection();

View File

@ -824,9 +824,10 @@ qr =
quote: (e) -> quote: (e) ->
e.preventDefault() e.preventDefault()
{target} = e {target} = e
unless dialog = $ '#qr' if dialog = $ '#qr'
qr.autohide.unset()
else
dialog = qr.dialog target dialog = qr.dialog target
qr.autohide.unset()
id = target.textContent id = target.textContent
text = ">>#{id}\n" text = ">>#{id}\n"