if (window.confirm(DIMP.text_compose.cancel)) {
if ((this.is_popup || DIMP.conf_compose.popup) &&
DIMP.baseWindow &&
- DIMP.baseWindow.DimpBase) {
+ DIMP.baseWindow.DimpBase &&
+ !DIMP.conf_compose.qreply) {
DIMP.baseWindow.focus();
}
DimpCore.doAction(DIMP.conf_compose.auto_save_interval_val ? 'DeleteDraft' : 'CancelCompose', { imp_compose: $F('composeCache') }, { ajaxopts: { asynchronous: DIMP.conf_compose.qreply } });
setMessageText: function(r)
{
var ta = $('composeMessage');
+
if (!ta) {
$('composeMessageParent').insert(new Element('TEXTAREA', { id: 'composeMessage', name: 'message', style: 'width:100%' }).insert(r.response.text));
} else {
}
},
- // opts = auto, focus, fwd_list, noupdate
+ // opts = auto, focus, fwd_list, noupdate, show_editor
fillForm: function(msg, header, opts)
{
// On IE, this can get loaded before DOM:loaded.
this.auto_save_interval.execute();
}
- this.setBodyText(msg, true);
-
$('to').setValue(header.to);
if (header.cc) {
$('cc').setValue(header.cc);
break;
}
- if (DIMP.conf_compose.show_editor) {
+ this.setBodyText(msg);
+ this.resizeMsgArea();
+
+ if (DIMP.conf_compose.show_editor || opts.show_editor) {
if (!IMP_Compose_Base.editor_on) {
this.toggleHtmlEditor(opts.noupdate);
}
* size by the available height, round down to the lowest integer
* row, and resize the textarea. */
rows = parseInt(mah / (msg.clientHeight / msg.getAttribute('rows')), 10);
- msg.writeAttribute({ rows: rows, disabled: false });
- if (de.scrollHeight - de.clientHeight) {
- msg.writeAttribute('rows', rows - 1);
+ if (!isNaN(rows)) {
+ msg.writeAttribute({ rows: rows, disabled: false });
+ if (de.scrollHeight - de.clientHeight) {
+ msg.writeAttribute('rows', rows - 1);
+ }
}
}
},
return;
}
- var r = result.response,
- editor_on = ((r.format == 'html') && !DimpCompose.editor_on),
- id = (r.identity === null) ? $F('identity') : r.identity,
- i = DimpCompose.getIdentity(id, editor_on);
+ var i,
+ r = result.response,
+ id = (r.identity === null) ? $F('identity') : r.identity;
+
+ r.opts.noupdate = true;
+ r.opts.show_editor = (r.format == 'html');
+
+ i = IMP_Compose_Base.getIdentity(id, r.opts.show_editor);
$('identity', 'last_identity').invoke('setValue', id);
DimpCompose.fillForm((i.id[2]) ? ("\n" + i.sig + r.body) : (r.body + "\n" + i.sig), r.header, r.opts);
- if (editor_on) {
- DimpCompose.toggleHtmlEditor(true);
- }
-
if (r.imp_compose) {
$('composeCache').setValue(r.imp_compose);
}