Skip to content

Commit

Permalink
Vastly simplify, since setValue() only requires tru-ish value.
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Apr 13, 2014
1 parent b07e3ba commit 81abeb4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions imp/js/compose-dimp.js
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ var DimpCompose = {

ImpComposeBase.editor_on = rte;
$('htmlcheckbox').setValue(rte);
$('html').setValue(~~(!!rte));
$('html').setValue(rte);
},

// ob = addr, body, format, identity, opts, subject, type
Expand Down Expand Up @@ -1267,8 +1267,7 @@ var DimpCompose = {
if (id.startsWith(pair.key + '_')) {
var t = pair.value.get(id.substring(pair.key.length + 1));
if (t) {
// ~~!! = Integer value of the inverse of t.
$(t).setValue(~~(!!$F(t)));
$(t).setValue(!$F(t));
}
}
});
Expand Down
2 changes: 1 addition & 1 deletion imp/js/compose.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ var ImpCompose = {
break;

case 'rte_toggle':
$('rtemode').setValue(~~(!!ImpComposeBase.editor_on));
$('rtemode').setValue(!ImpComposeBase.editor_on);
this.uniqSubmit('toggle_editor');
break;

Expand Down

0 comments on commit 81abeb4

Please sign in to comment.