Projects
Kolab:16:Testing:Candidate
roundcubemail-plugins-kolab
0002-Elastic-Fix-Save-Edit-buttons-on-plain-tex...
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0002-Elastic-Fix-Save-Edit-buttons-on-plain-text-editor-B.patch of Package roundcubemail-plugins-kolab (Revision 47)
Currently displaying revision
47
,
Show latest
From 4b0562086724d6b4d5f1537a5d42a0a6034e8351 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <machniak@kolabsys.com> Date: Tue, 22 Jan 2019 09:44:45 +0000 Subject: [PATCH 2/3] Elastic: Fix Save/Edit buttons on plain text editor (Bifrost#T173153) --- plugins/kolab_files/kolab_files.js | 11 ++++++---- plugins/kolab_files/skins/elastic/ui.js | 27 ++++++++++++------------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js index 3a60ddb1..c32ea009 100644 --- a/plugins/kolab_files/kolab_files.js +++ b/plugins/kolab_files/kolab_files.js @@ -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; diff --git a/plugins/kolab_files/skins/elastic/ui.js b/plugins/kolab_files/skins/elastic/ui.js index 48c23dfa..33edbb12 100644 --- a/plugins/kolab_files/skins/elastic/ui.js +++ b/plugins/kolab_files/skins/elastic/ui.js @@ -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'); } -- 2.20.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.