Disable some toolbar buttons if Mailvelope editor is active (#1490533)
| | |
| | | .find('iframe:not([aria-hidden=true])').remove(); |
| | | $('#' + ref.env.composebody).show(); |
| | | $("[name='_pgpmime']").remove(); |
| | | |
| | | // disable commands that operate on the compose body |
| | | ref.enable_command('spellcheck', 'insert-sig', 'toggle-editor', 'insert-response', 'save-response', true); |
| | | ref.triggerEvent('compose-encrypted', { active:false }); |
| | | } |
| | | // embed Mailvelope editor container |
| | | else { |
| | |
| | | container.addClass('mailvelope'); |
| | | $('#' + ref.env.composebody).hide(); |
| | | |
| | | // disable commands that operate on the compose body |
| | | ref.enable_command('spellcheck', 'insert-sig', 'toggle-editor', 'insert-response', 'save-response', false); |
| | | ref.triggerEvent('compose-encrypted', { active:true }); |
| | | |
| | | // notify user about loosing attachments |
| | | if (ref.env.attachments && !$.isEmptyObject(ref.env.attachments)) { |
| | | alert(ref.get_label('encryptnoattachments')); |
| | |
| | | window.setTimeout(function(){ layout_composeview() }, 200); |
| | | if (e && e.mode) |
| | | $("select[name='editorSelector']").val(e.mode); |
| | | }) |
| | | .addEventListener('compose-encrypted', function(e) { |
| | | $("select[name='editorSelector']").prop('disabled', e.active); |
| | | $('a.button.attach, a.button.responses')[(e.active?'addClass':'removeClass')]('disabled'); |
| | | }); |
| | | |
| | | // Show input elements with non-empty value |
| | |
| | | return; |
| | | } |
| | | |
| | | // do nothing if mailvelope editor is active |
| | | if (rcmail.mailvelope_editor) |
| | | return; |
| | | |
| | | // add icons to clone file input field |
| | | if (rcmail.env.action == 'compose' && !$dialog.data('extended')) { |
| | | $('<a>') |