implemented interface for desktop app
This commit is contained in:
parent
f3f7536da0
commit
cee6024b35
|
@ -281,13 +281,14 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
setExtra: function (place, el) {
|
setExtra: function (place, el) {
|
||||||
if ( this.$tabs ) {
|
if ( !!el ) {
|
||||||
} else {
|
if (this.$tabs) {
|
||||||
if ( place == 'right' ) {
|
} else {
|
||||||
this.$layout.find('.extra.right').html(el);
|
if (place == 'right') {
|
||||||
} else
|
this.$layout.find('.extra.right').html(el);
|
||||||
if ( place == 'left' ) {
|
} else if (place == 'left') {
|
||||||
this.$layout.find('.extra.left').html(el);
|
this.$layout.find('.extra.left').html(el);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,13 +208,14 @@ define([
|
||||||
me.fireEvent('go:back', ['page:' + item.value]);
|
me.fireEvent('go:back', ['page:' + item.value]);
|
||||||
})
|
})
|
||||||
|
|
||||||
me.logo.on('click', function (e) {
|
if ( me.logo )
|
||||||
var _url = !!me.branding && !!me.branding.logo && !!me.branding.logo.url ?
|
me.logo.on('click', function (e) {
|
||||||
me.branding.logo.url : 'http://www.onlyoffice.com';
|
var _url = !!me.branding && !!me.branding.logo && !!me.branding.logo.url ?
|
||||||
|
me.branding.logo.url : 'http://www.onlyoffice.com';
|
||||||
|
|
||||||
var newDocumentPage = window.open(_url);
|
var newDocumentPage = window.open(_url);
|
||||||
newDocumentPage && newDocumentPage.focus();
|
newDocumentPage && newDocumentPage.focus();
|
||||||
});
|
});
|
||||||
|
|
||||||
$panelUsers.on('shown.bs.dropdown', function () {
|
$panelUsers.on('shown.bs.dropdown', function () {
|
||||||
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
|
$userList.scroller && $userList.scroller.update({minScrollbarLength: 40, alwaysVisibleY: true});
|
||||||
|
@ -239,13 +240,15 @@ define([
|
||||||
$labelChangeRights[(!mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length)?'show':'hide']();
|
$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']();
|
$panelUsers[(storeUsers.size() > 1 || !mode.isOffline && !mode.isReviewOnly && mode.sharingSettingsUrl && mode.sharingSettingsUrl.length) ? 'show' : 'hide']();
|
||||||
|
|
||||||
$saveStatus.attr('data-width', me.textSaveExpander);
|
if ( $saveStatus ) {
|
||||||
if ( appConfig.canUseHistory ) {
|
$saveStatus.attr('data-width', me.textSaveExpander);
|
||||||
// $saveStatus.on('click', function(e) {
|
if (appConfig.canUseHistory) {
|
||||||
// me.fireEvent('history:show', ['header']);
|
// $saveStatus.on('click', function(e) {
|
||||||
// });
|
// me.fireEvent('history:show', ['header']);
|
||||||
} else {
|
// });
|
||||||
$saveStatus.addClass('locked');
|
} else {
|
||||||
|
$saveStatus.addClass('locked');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -310,8 +313,8 @@ define([
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
getPanel: function (role) {
|
getPanel: function (role, config) {
|
||||||
if ( role == 'left' ) {
|
if ( role == 'left' && (!config || !config.isDesktopApp)) {
|
||||||
$html = $(templateLeftBox);
|
$html = $(templateLeftBox);
|
||||||
this.logo = $html.find('#header-logo');
|
this.logo = $html.find('#header-logo');
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -323,8 +326,23 @@ define([
|
||||||
textSaveEnd: this.textSaveEnd
|
textSaveEnd: this.textSaveEnd
|
||||||
}));
|
}));
|
||||||
|
|
||||||
if ( this.canBack === true ) {
|
this.labelDocName = $html.find('#rib-doc-name');
|
||||||
this.btnGoBack.render($html.find('#slot-btn-back'));
|
$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 ) {
|
if ( this.documentCaption ) {
|
||||||
|
@ -332,14 +350,11 @@ define([
|
||||||
Common.Utils.String.htmlEncode(this.documentCaption) );
|
Common.Utils.String.htmlEncode(this.documentCaption) );
|
||||||
}
|
}
|
||||||
|
|
||||||
this.labelDocName = $html.find('#rib-doc-name');
|
|
||||||
$userList = $html.find('.cousers-list');
|
$userList = $html.find('.cousers-list');
|
||||||
$panelUsers = $html.find('.box-cousers');
|
$panelUsers = $html.find('.box-cousers');
|
||||||
$btnUsers = $html.find('.btn-users');
|
$btnUsers = $html.find('.btn-users');
|
||||||
$saveStatus = $html.find('#rib-save-status');
|
|
||||||
|
|
||||||
$panelUsers.hide();
|
$panelUsers.hide();
|
||||||
$saveStatus.hide();
|
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,8 +47,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&.right {
|
&.right {
|
||||||
min-width: 150px;
|
min-width: 100px;
|
||||||
padding-right: 12px;
|
padding-right: 12px;
|
||||||
|
|
||||||
|
.desktop {
|
||||||
|
padding: 10px 0;
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#rib-doc-name {
|
#rib-doc-name {
|
||||||
|
@ -57,6 +62,7 @@
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
min-width: 50px;
|
min-width: 50px;
|
||||||
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
#rib-save-status {
|
#rib-save-status {
|
||||||
|
|
|
@ -49,6 +49,7 @@
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-top: 1px solid @gray-dark;
|
border-top: 1px solid @gray-dark;
|
||||||
top: @height-tabs - 1;
|
top: @height-tabs - 1;
|
||||||
|
left: 0;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,8 +70,9 @@ define([
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'Toolbar': {
|
'Toolbar': {
|
||||||
'render:before' : function (toolbar) {
|
'render:before' : function (toolbar) {
|
||||||
toolbar.setExtra('right', me.header.getPanel('right'));
|
var config = DE.getController('Main').appOptions;
|
||||||
toolbar.setExtra('left', me.header.getPanel('left'));
|
toolbar.setExtra('right', me.header.getPanel('right', config));
|
||||||
|
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||||
},
|
},
|
||||||
'view:compact' : function (toolbar, state) {
|
'view:compact' : function (toolbar, state) {
|
||||||
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
|
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
|
||||||
|
|
|
@ -71,8 +71,9 @@ define([
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'Toolbar': {
|
'Toolbar': {
|
||||||
'render:before' : function (toolbar) {
|
'render:before' : function (toolbar) {
|
||||||
toolbar.setExtra('right', me.header.getPanel('right'));
|
var config = PE.getController('Main').appOptions;
|
||||||
toolbar.setExtra('left', me.header.getPanel('left'));
|
toolbar.setExtra('right', me.header.getPanel('right', config));
|
||||||
|
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||||
},
|
},
|
||||||
'view:compact' : function (toolbar, state) {
|
'view:compact' : function (toolbar, state) {
|
||||||
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
|
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
|
||||||
|
|
|
@ -69,8 +69,9 @@ define([
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'Toolbar': {
|
'Toolbar': {
|
||||||
'render:before' : function (toolbar) {
|
'render:before' : function (toolbar) {
|
||||||
toolbar.setExtra('right', me.header.getPanel('right'));
|
var config = SSE.getController('Main').appOptions;
|
||||||
toolbar.setExtra('left', me.header.getPanel('left'));
|
toolbar.setExtra('right', me.header.getPanel('right', config));
|
||||||
|
toolbar.setExtra('left', me.header.getPanel('left', config));
|
||||||
},
|
},
|
||||||
'view:compact' : function (toolbar, state) {
|
'view:compact' : function (toolbar, state) {
|
||||||
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
|
me.viewport.vlayout.panels[0].height = state ? 40 : 40+67;
|
||||||
|
|
Loading…
Reference in a new issue