Copy compose options into the main compose form

pull/5742/merge
Aleksander Machniak 8 years ago
parent c142b13377
commit 7d81b6166a

@ -50,7 +50,7 @@
<div class="form-group row form-check">
<label for="compose-mdn" class="col-form-label col-6"><roundcube:label name="returnreceipt" /></label>
<div class="col-6 form-check">
<roundcube:object name="mdnCheckBox" form="form" id="compose-mdn" tabindex="2" class="form-check-input" />
<roundcube:object name="mdnCheckBox" id="compose-mdn" noform="true" tabindex="2" class="form-check-input" />
</div>
</div>
<roundcube:endif />
@ -58,21 +58,21 @@
<div class="form-group row form-check">
<label for="compose-dsn" class="col-form-label col-6"><roundcube:label name="dsn" /></label>
<div class="col-6 form-check">
<roundcube:object name="dsnCheckBox" form="form" id="compose-dsn" tabindex="2" class="form-check-input" />
<roundcube:object name="dsnCheckBox" id="compose-dsn" noform="true" tabindex="2" class="form-check-input" />
</div>
</div>
<roundcube:endif />
<div class="form-group row">
<label for="compose-priority" class="col-form-label col-6"><roundcube:label name="priority" /></label>
<div class="col-6">
<roundcube:object name="prioritySelector" form="form" id="compose-priority" tabindex="2" class="form-control" />
<roundcube:object name="prioritySelector" id="compose-priority" noform="true" tabindex="2" class="form-control" />
</div>
</div>
<roundcube:if condition="!config:no_save_sent_messages" />
<div class="form-group row">
<label for="compose-store-target" class="col-form-label col-6"><roundcube:label name="savesentmessagein" /></label>
<div class="col-6">
<roundcube:object name="storetarget" id="compose-store-target" tabindex="2" class="form-control" />
<roundcube:object name="storetarget" id="compose-store-target" noform="true" tabindex="2" class="form-control" />
</div>
</div>
<roundcube:endif />
@ -81,7 +81,7 @@
<div class="form-group row">
<label for="editor-selector" class="col-form-label col-6"><roundcube:label name="editortype" /></label>
<div class="col-6">
<roundcube:object name="editorSelector" id="editor-selector" editorid="composebody" tabindex="2" class="form-control" />
<roundcube:object name="editorSelector" id="editor-selector" editorid="composebody" noform="true" tabindex="2" class="form-control" />
</div>
</div>
<roundcube:endif />

@ -155,6 +155,18 @@ function rcube_elastic_ui()
$('#compose' + $(this).attr('id'))[this.value ? 'removeClass' : 'addClass']('hidden');
});
});
// We put compose options for outside of the main form
// Because IE/Edge does not support 'form' attribute we'll copy
// inputs into the main form hidden fields
// TODO: Consider doing this for IE/Edge only, just set the 'form' attribute on others
$('#compose-options').find('textarea,input,select').each(function() {
var hidden = $('<input>')
.attr({type: 'hidden', name: $(this).attr('name')})
.appendTo(rcmail.gui_objects.messageform);
$(this).on('change', function() { hidden.val($(this).val()); }).change();
});
};
/**

Loading…
Cancel
Save