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;
e.preventDefault();
target = e.target;
if (!(dialog = $('#qr'))) {
if (dialog = $('#qr')) {
qr.autohide.unset();
} else {
dialog = qr.dialog(target);
}
qr.autohide.unset();
id = target.textContent;
text = ">>" + id + "\n";
selection = window.getSelection();

View File

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