mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 08:55:16 +08:00
[win-nix] fix button Home visibility
This commit is contained in:
@ -121,6 +121,12 @@ define([
|
||||
if ( !$.isEmptyObject(titlebuttons) ) {
|
||||
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
||||
if (header) {
|
||||
if ( native.getViewportSettings ) {
|
||||
const viewport = native.getViewportSettings();
|
||||
if ( viewport.widgetType == 'window' && titlebuttons.home )
|
||||
titlebuttons.home.btn.setVisible(true);
|
||||
}
|
||||
|
||||
for (var i in titlebuttons) {
|
||||
opts.title.buttons.push(_serializeHeaderButton(i, titlebuttons[i]));
|
||||
}
|
||||
@ -225,7 +231,7 @@ define([
|
||||
icon: config.icon || undefined,
|
||||
hint: config.btn.options.hint,
|
||||
disabled: config.btn.isDisabled(),
|
||||
visible: config.visible,
|
||||
visible: config.btn.isVisible(),
|
||||
};
|
||||
};
|
||||
|
||||
@ -408,10 +414,15 @@ define([
|
||||
var header = webapp.getController('Viewport').getView('Common.Views.Header');
|
||||
|
||||
{
|
||||
let viewport;
|
||||
if ( native.getViewportSettings ) {
|
||||
viewport = native.getViewportSettings();
|
||||
}
|
||||
|
||||
header.btnHome = (new Common.UI.Button({
|
||||
cls: 'btn-header',
|
||||
iconCls: 'toolbar__icon icon--inverse btn-home',
|
||||
visible: false,
|
||||
visible: viewport && viewport.widgetType == 'window',
|
||||
hint: Common.Locale.get('hintBtnHome', {name:"Common.Controllers.Desktop", default: 'Show Main window'}),
|
||||
dataHint:'0',
|
||||
dataHintDirection: 'right',
|
||||
|
||||
Reference in New Issue
Block a user