hide some buttons for desktop mode

This commit is contained in:
Maxim Kadushkin 2018-02-07 18:30:45 +03:00
parent 472e5edcb7
commit b5a5c97735
3 changed files with 50 additions and 15 deletions

View file

@ -2768,12 +2768,23 @@ define([
if ( $panel ) if ( $panel )
me.toolbar.addTab(tab, $panel, 4); me.toolbar.addTab(tab, $panel, 4);
if (config.isDesktopApp && config.isOffline) { if ( config.isDesktopApp ) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
if ( config.isOffline ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect}; tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel(); $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ( $panel ) if ($panel) me.toolbar.addTab(tab, $panel, 5);
me.toolbar.addTab(tab, $panel, 5); }
} }
var links = me.getApplication().getController('Links'); var links = me.getApplication().getController('Links');

View file

@ -2091,13 +2091,25 @@ define([
if ( $panel ) if ( $panel )
me.toolbar.addTab(tab, $panel, 3); me.toolbar.addTab(tab, $panel, 3);
if (config.isDesktopApp && config.isOffline) { if ( config.isDesktopApp ) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
if ( config.isOffline ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect}; tab = {action: 'protect', caption: me.toolbar.textTabProtect};
$panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel(); $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ( $panel ) if ($panel)
me.toolbar.addTab(tab, $panel, 4); me.toolbar.addTab(tab, $panel, 4);
} }
} }
}
}, },
onAppReady: function (config) { onAppReady: function (config) {

View file

@ -3054,14 +3054,26 @@ define([
if ( $panel ) if ( $panel )
me.toolbar.addTab(tab, $panel, 4); me.toolbar.addTab(tab, $panel, 4);
if (config.isDesktopApp && config.isOffline) { if ( config.isDesktopApp ) {
// hide 'print' and 'save' buttons group and next separator
me.toolbar.btnPrint.$el.parents('.group').hide().next().hide();
// hide 'undo' and 'redo' buttons and get container
var $box = me.toolbar.btnUndo.$el.hide().next().hide().parent();
// move 'paste' button to the container instead of 'undo' and 'redo'
me.toolbar.btnPaste.$el.detach().appendTo($box);
me.toolbar.btnCopy.$el.removeClass('split');
if ( config.isOffline ) {
tab = {action: 'protect', caption: me.toolbar.textTabProtect}; tab = {action: 'protect', caption: me.toolbar.textTabProtect};
var $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel(); var $panel = me.getApplication().getController('Common.Controllers.Protection').createToolbarPanel();
if ( $panel ) if ($panel)
me.toolbar.addTab(tab, $panel, 5); me.toolbar.addTab(tab, $panel, 5);
} }
} }
} }
}
}); });
}, },