Skip to content

Commit

Permalink
Cleanup wait handling a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Nov 22, 2013
1 parent e11e3d7 commit aa981af
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions imp/js/compose-dimp.js
Expand Up @@ -209,7 +209,7 @@ var DimpCompose = {
this.skip_spellcheck = true;
}

if (this.editor_wait && ImpComposeBase.editor_on) {
if (this.editor_wait) {
return this.uniqueSubmit.bind(this, action).defer();
}

Expand Down Expand Up @@ -391,11 +391,12 @@ var DimpCompose = {
}

noupdate = noupdate || false;
if ((sc = ImpComposeBase.getSpellChecker())) {
if ((sc = ImpComposeBase.getSpellChecker()) && sc.isActive()) {
sc.resume();
if (this.editor_wait) {
return this.toggleHtmlEditor.bind(this, noupdate).defer();
}
}

if (this.editor_wait) {
return this.toggleHtmlEditor.bind(this, noupdate).defer();
}

if (ImpComposeBase.editor_on) {
Expand Down Expand Up @@ -504,8 +505,7 @@ var DimpCompose = {
_onSpellCheckAfter: function()
{
if (ImpComposeBase.editor_on) {
this.editor_wait = true;
this.rte.setData($F('composeMessage'), function() { this.editor_wait = false; }.bind(this));
this.setBodyText({ body: $F('composeMessage') });
$('composeMessage').next().show();
this.RTELoading('hide');
}
Expand Down Expand Up @@ -737,7 +737,9 @@ var DimpCompose = {
{
if (ImpComposeBase.editor_on) {
this.editor_wait = true;
this.rte.setData(ob.body, function() { this.editor_wait = false; }.bind(this));
this.rte.setData(ob.body, function() {
this.editor_wait = false;
}.bind(this));
} else {
$('composeMessage').setValue(ob.body);
ImpComposeBase.setCursorPosition('composeMessage', DimpCore.conf.compose_cursor);
Expand Down

0 comments on commit aa981af

Please sign in to comment.