[desktop] added button 'home' in app header

This commit is contained in:
Maxim Kadushkin 2022-09-28 23:43:03 +03:00
parent fd961d81a2
commit 27ff2a57e7
8 changed files with 27 additions and 4 deletions

View file

@ -93,8 +93,9 @@ define([
}
if ( obj.singlewindow !== undefined ) {
$('#box-document-title .hedset')[obj.singlewindow ? 'hide' : 'show']();
// $('#box-document-title .hedset')[obj.singlewindow ? 'hide' : 'show']();
native.features.singlewindow = obj.singlewindow;
titlebuttons.home && titlebuttons.home.btn.setVisible(obj.singlewindow);
}
} else
if (/editor:config/.test(cmd)) {
@ -245,6 +246,26 @@ define([
titlebuttons = {};
if ( mode.isEdit ) {
var header = webapp.getController('Viewport').getView('Common.Views.Header');
{
header.btnHome = (new Common.UI.Button({
cls: 'btn-header',
iconCls: 'toolbar__icon icon--inverse btn-home',
disabled: true,
visible: false,
hint: 'Show Main window',
dataHint:'0',
dataHintDirection: 'right',
dataHintOffset: '10, -18',
dataHintTitle: 'K'
})).render($('#box-document-title #slot-btn-dt-home'));
titlebuttons['home'] = {btn: header.btnHome};
header.btnHome.on('click', event => {
native.execCommand('title:button', JSON.stringify({click: "home"}));
});
}
if (!!header.btnSave) {
titlebuttons['save'] = {btn: header.btnSave};
@ -278,7 +299,8 @@ define([
}
if ( native.features.singlewindow !== undefined ) {
$('#box-document-title .hedset')[native.features.singlewindow ? 'hide' : 'show']();
// $('#box-document-title .hedset')[native.features.singlewindow ? 'hide' : 'show']();
!!titlebuttons.home && titlebuttons.home.btn.setVisible(native.features.singlewindow);
}
});

View file

@ -121,7 +121,7 @@ Common.UI.HintManager = new(function() {
_usedTitles = [],
_appPrefix,
_staticHints = { // for desktop buttons
"btnhome": 'K'
// "btnhome": 'K'
};
var _api;

View file

@ -123,9 +123,10 @@ define([
'<div id="header-logo"><i></i></div>' +
'</section>';
var templateTitleBox = '<section id="box-document-title">' +
var templateTitleBox = '<section id="box-document-title">' +
'<div class="extra"></div>' +
'<div class="hedset">' +
'<div class="btn-slot" id="slot-btn-dt-home"></div>' +
'<div class="btn-slot" id="slot-btn-dt-save" data-layout-name="header-save"></div>' +
'<div class="btn-slot" id="slot-btn-dt-print"></div>' +
'<div class="btn-slot" id="slot-btn-dt-undo"></div>' +

Binary file not shown.

After

Width:  |  Height:  |  Size: 653 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,012 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 511 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 968 B