implemented interface for desktop app

This commit is contained in:
Maxim Kadushkin 2017-05-04 15:36:42 +03:00
parent f3f7536da0
commit cee6024b35
7 changed files with 60 additions and 34 deletions

View file

@ -281,16 +281,17 @@ define([
},
setExtra: function (place, el) {
if ( !!el ) {
if (this.$tabs) {
} else {
if (place == 'right') {
this.$layout.find('.extra.right').html(el);
} else
if ( place == 'left' ) {
} else if (place == 'left') {
this.$layout.find('.extra.left').html(el);
}
}
}
}
};
}()));
});

View file

@ -208,6 +208,7 @@ define([
me.fireEvent('go:back', ['page:' + item.value]);
})
if ( me.logo )
me.logo.on('click', function (e) {
var _url = !!me.branding && !!me.branding.logo && !!me.branding.logo.url ?
me.branding.logo.url : 'http://www.onlyoffice.com';
@ -239,6 +240,7 @@ define([
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
$panelUsers[(storeUsers.size() > 1 || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
if ( $saveStatus ) {
$saveStatus.attr('data-width', me.textSaveExpander);
if (appConfig.canUseHistory) {
// $saveStatus.on('click', function(e) {
@ -248,6 +250,7 @@ define([
$saveStatus.addClass('locked');
}
}
}
return {
options: {
@ -310,8 +313,8 @@ define([
return this;
},
getPanel: function (role) {
if ( role == 'left' ) {
getPanel: function (role, config) {
if ( role == 'left' && (!config || !config.isDesktopApp)) {
$html = $(templateLeftBox);
this.logo = $html.find('#header-logo');
return $html;
@ -323,8 +326,23 @@ define([
textSaveEnd: this.textSaveEnd
}));
this.labelDocName = $html.find('#rib-doc-name');
$saveStatus = $html.find('#rib-save-status');
$saveStatus.hide();
if ( config && config.isDesktopApp ) {
$html.addClass('desktop');
$html.find('#slot-btn-back').hide();
this.labelDocName.hide();
if ( config.isOffline )
$saveStatus = false;
} else {
if ( this.canBack === true ) {
this.btnGoBack.render($html.find('#slot-btn-back'));
} else {
$html.find('#slot-btn-back').hide();
}
}
if ( this.documentCaption ) {
@ -332,14 +350,11 @@ define([
Common.Utils.String.htmlEncode(this.documentCaption) );
}
this.labelDocName = $html.find('#rib-doc-name');
$userList = $html.find('.cousers-list');
$panelUsers = $html.find('.box-cousers');
$btnUsers = $html.find('.btn-users');
$saveStatus = $html.find('#rib-save-status');
$panelUsers.hide();
$saveStatus.hide();
return $html;
}

View file

@ -47,8 +47,13 @@
}
&.right {
min-width: 150px;
min-width: 100px;
padding-right: 12px;
.desktop {
padding: 10px 0;
text-align: right;
}
}
#rib-doc-name {
@ -57,6 +62,7 @@
text-overflow: ellipsis;
overflow: hidden;
min-width: 50px;
text-align: right;
}
#rib-save-status {

View file

@ -49,6 +49,7 @@
width: 100%;
border-top: 1px solid @gray-dark;
top: @height-tabs - 1;
left: 0;
z-index: 1;
}
}

View file

@ -70,8 +70,9 @@ define([
this.addListeners({
'Toolbar': {
'render:before' : function (toolbar) {
toolbar.setExtra('right', me.header.getPanel('right'));
toolbar.setExtra('left', me.header.getPanel('left'));
var config = DE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config));
toolbar.setExtra('left', me.header.getPanel('left', config));
},
'view:compact' : function (toolbar, state) {
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;

View file

@ -71,8 +71,9 @@ define([
this.addListeners({
'Toolbar': {
'render:before' : function (toolbar) {
toolbar.setExtra('right', me.header.getPanel('right'));
toolbar.setExtra('left', me.header.getPanel('left'));
var config = PE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config));
toolbar.setExtra('left', me.header.getPanel('left', config));
},
'view:compact' : function (toolbar, state) {
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;

View file

@ -69,8 +69,9 @@ define([
this.addListeners({
'Toolbar': {
'render:before' : function (toolbar) {
toolbar.setExtra('right', me.header.getPanel('right'));
toolbar.setExtra('left', me.header.getPanel('left'));
var config = SSE.getController('Main').appOptions;
toolbar.setExtra('right', me.header.getPanel('right', config));
toolbar.setExtra('left', me.header.getPanel('left', config));
},
'view:compact' : function (toolbar, state) {
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;