Elastic: Fix Save/Edit buttons on plain text editor (Bifrost#T173153)
This commit is contained in:
parent
5834133fad
commit
4b05620867
2 changed files with 20 additions and 18 deletions
|
@ -1251,10 +1251,6 @@ function kolab_files_frame_load(frame)
|
|||
}
|
||||
catch (e) {};
|
||||
|
||||
// on edit page switch immediately to edit mode
|
||||
if (rcmail.file_editor && rcmail.file_editor.editable && rcmail.env.action == 'edit')
|
||||
rcmail.files_edit();
|
||||
|
||||
rcmail.enable_command('files-edit', (rcmail.file_editor && rcmail.file_editor.editable)
|
||||
|| rcmail.env.editor_type
|
||||
|| (file_api.file_type_supported(rcmail.env.file_data.type, rcmail.env.files_caps) & 4));
|
||||
|
@ -1266,6 +1262,10 @@ function kolab_files_frame_load(frame)
|
|||
rcmail.enable_command('image-scale', 'image-rotate', info && !!/^image\//.test(info.type));
|
||||
rcmail.gui_objects.messagepartframe = frame;
|
||||
|
||||
// on edit page switch immediately to edit mode
|
||||
if (rcmail.file_editor && rcmail.file_editor.editable && rcmail.env.action == 'edit')
|
||||
rcmail.files_edit();
|
||||
|
||||
// detect Print button and check if it can be accessed
|
||||
try {
|
||||
if ($('#fileframe').contents().find('#print').length)
|
||||
|
@ -3895,6 +3895,9 @@ function kolab_files_ui()
|
|||
_frame: 1
|
||||
};
|
||||
|
||||
if (rcmail.is_framed())
|
||||
args._framed = 1;
|
||||
|
||||
if (params && params.session)
|
||||
args._session = params.session;
|
||||
|
||||
|
|
|
@ -78,9 +78,20 @@ function kolab_files_members_list(link)
|
|||
};
|
||||
|
||||
|
||||
if (rcmail.env.action == 'open') {
|
||||
if (rcmail.env.action == 'open' || rcmail.env.action == 'edit') {
|
||||
rcmail.addEventListener('enable-command', kolab_files_enable_command);
|
||||
|
||||
if (rcmail.env.action == 'open') {
|
||||
$('#toolbar-menu a.button.save').parent().hide();
|
||||
}
|
||||
else if (rcmail.env.action == 'edit') {
|
||||
if (rcmail.env.editor_type == 'wopi' && rcmail.is_framed()) {
|
||||
parent.$('.ui-dialog:visible .ui-dialog-buttonpane').addClass('hidden');
|
||||
}
|
||||
|
||||
rcmail.gui_object('exportmenu', 'export-menu');
|
||||
}
|
||||
|
||||
// center and scale the image in preview frame
|
||||
if (rcmail.env.mimetype.startsWith('image/')) {
|
||||
$('#fileframe').on('load', function() {
|
||||
|
@ -92,7 +103,7 @@ if (rcmail.env.action == 'open') {
|
|||
}
|
||||
|
||||
// Elastic mobile preview uses an iframe in a dialog
|
||||
if (rcmail.is_framed()) {
|
||||
if ((rcmail.env.action == 'open' || rcmail.env.editor_type != 'wopi') && rcmail.is_framed()) {
|
||||
var edit_button = $('#filetoolbar a.button.edit'),
|
||||
save_button = $('#filetoolbar a.button.save');
|
||||
|
||||
|
@ -111,9 +122,6 @@ if (rcmail.env.action == 'open') {
|
|||
);
|
||||
}
|
||||
}
|
||||
else if (rcmail.env.action == 'edit') {
|
||||
rcmail.gui_object('exportmenu', 'export-menu');
|
||||
}
|
||||
else {
|
||||
rcmail.addEventListener('files-folder-select', function(p) {
|
||||
var is_sess = p.folder == 'folder-collection-sessions';
|
||||
|
@ -126,15 +134,6 @@ else {
|
|||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
if (rcmail.env.action == 'open') {
|
||||
$('#toolbar-menu a.button.save').parent().hide();
|
||||
}
|
||||
else if (rcmail.env.action == 'edit') {
|
||||
if (rcmail.is_framed()) {
|
||||
parent.$('.ui-dialog:visible .ui-dialog-buttonpane').addClass('hidden');
|
||||
}
|
||||
}
|
||||
|
||||
if ($('#dragfilemenu').length) {
|
||||
rcmail.gui_object('file_dragmenu', 'dragfilemenu');
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue