[PE] Show File and Plugins tabs in view mode
This commit is contained in:
parent
869bc1a7a6
commit
232ced3282
|
@ -423,7 +423,7 @@ define([
|
|||
toolbarView = application.getController('Toolbar').getView('Toolbar');
|
||||
|
||||
application.getController('DocumentHolder').getView('DocumentHolder').focus();
|
||||
if (this.api && this.api.asc_isDocumentCanSave) {
|
||||
if (this.api && this.appOptions.isEdit && this.api.asc_isDocumentCanSave) {
|
||||
var cansave = this.api.asc_isDocumentCanSave(),
|
||||
forcesave = this.appOptions.forcesave,
|
||||
isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.$icon.hasClass('btn-synch') : false,
|
||||
|
@ -889,14 +889,15 @@ define([
|
|||
var app = this.getApplication(),
|
||||
viewport = app.getController('Viewport').getView('Viewport'),
|
||||
statusbarView = app.getController('Statusbar').getView('Statusbar'),
|
||||
documentHolder = app.getController('DocumentHolder').getView('DocumentHolder');
|
||||
documentHolder = app.getController('DocumentHolder').getView('DocumentHolder'),
|
||||
toolbarController = app.getController('Toolbar');
|
||||
|
||||
// appHeader.setHeaderCaption(this.appOptions.isEdit ? 'Presentation Editor' : 'Presentation Viewer');
|
||||
// appHeader.setVisible(!this.appOptions.nativeApp && !value && !this.appOptions.isDesktopApp);
|
||||
|
||||
viewport && viewport.setMode(this.appOptions, true);
|
||||
statusbarView && statusbarView.setMode(this.appOptions);
|
||||
|
||||
toolbarController.setMode(this.appOptions);
|
||||
documentHolder.setMode(this.appOptions);
|
||||
|
||||
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
||||
|
@ -936,20 +937,17 @@ define([
|
|||
|
||||
viewport.applyEditorMode();
|
||||
|
||||
var rightmenuView = rightmenuController.getView('RightMenu');
|
||||
if (rightmenuView) {
|
||||
rightmenuView.setApi(me.api);
|
||||
rightmenuView.on('editcomplete', _.bind(me.onEditComplete, me));
|
||||
rightmenuView.setMode(me.appOptions);
|
||||
}
|
||||
|
||||
var toolbarView = (toolbarController) ? toolbarController.getView('Toolbar') : null;
|
||||
|
||||
_.each([
|
||||
toolbarView,
|
||||
rightmenuController.getView('RightMenu')
|
||||
], function(view) {
|
||||
if (view) {
|
||||
view.setApi(me.api);
|
||||
view.on('editcomplete', _.bind(me.onEditComplete, me));
|
||||
view.setMode(me.appOptions);
|
||||
}
|
||||
});
|
||||
|
||||
if (toolbarView) {
|
||||
toolbarView.setApi(me.api);
|
||||
toolbarView.on('editcomplete', _.bind(me.onEditComplete, me));
|
||||
toolbarView.on('insertimage', _.bind(me.onInsertImage, me));
|
||||
toolbarView.on('inserttable', _.bind(me.onInsertTable, me));
|
||||
toolbarView.on('insertshape', _.bind(me.onInsertShape, me));
|
||||
|
|
|
@ -222,9 +222,6 @@ define([
|
|||
|
||||
// Create toolbar view
|
||||
me.toolbar = me.createView('Toolbar');
|
||||
me.toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||
me.toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
||||
me.toolbar.btnRedo.on('disabled', _.bind(this.onBtnChangeState, this, 'redo:disabled'));
|
||||
|
||||
Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me));
|
||||
Common.NotificationCenter.on('app:face', me.onAppShowed.bind(me));
|
||||
|
@ -242,6 +239,11 @@ define([
|
|||
});
|
||||
},
|
||||
|
||||
setMode: function(mode) {
|
||||
this.mode = mode;
|
||||
this.toolbar.applyLayout(mode);
|
||||
},
|
||||
|
||||
attachUIEvents: function(toolbar) {
|
||||
/**
|
||||
* UI Events
|
||||
|
@ -253,8 +255,11 @@ define([
|
|||
toolbar.btnPreview.menu.on('item:click', _.bind(this.onPreviewItemClick, this));
|
||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
|
||||
toolbar.btnSave.on('click', _.bind(this.onSave, this));
|
||||
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||
toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
||||
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
||||
toolbar.btnRedo.on('disabled', _.bind(this.onBtnChangeState, this, 'redo:disabled'));
|
||||
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
||||
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
||||
toolbar.btnBold.on('click', _.bind(this.onBold, this));
|
||||
|
@ -349,7 +354,7 @@ define([
|
|||
},
|
||||
|
||||
onChangeCompactView: function(view, compact) {
|
||||
this.toolbar.setFolded(compact);
|
||||
this.toolbar.setFolded(compact, 1);
|
||||
this.toolbar.fireEvent('view:compact', [this.toolbar, compact]);
|
||||
|
||||
Common.localStorage.setBool('pe-compact-toolbar', compact);
|
||||
|
@ -1963,7 +1968,8 @@ define([
|
|||
var toolbar = this.toolbar;
|
||||
toolbar.$el.find('.toolbar').toggleClass('masked', disable);
|
||||
|
||||
this.toolbar.lockToolbar(PE.enumLock.menuFileOpen, disable, {array: toolbar.btnsAddSlide.concat(toolbar.btnChangeSlide, toolbar.btnPreview)});
|
||||
if (toolbar.btnsAddSlide) // toolbar buttons are rendered
|
||||
this.toolbar.lockToolbar(PE.enumLock.menuFileOpen, disable, {array: toolbar.btnsAddSlide.concat(toolbar.btnChangeSlide, toolbar.btnPreview)});
|
||||
if(disable) {
|
||||
mask = $("<div class='toolbar-mask'>").appendTo(toolbar.$el.find('.toolbar'));
|
||||
Common.util.Shortcuts.suspendEvents('command+k, ctrl+k, alt+h, command+f5, ctrl+f5');
|
||||
|
@ -1993,6 +1999,8 @@ define([
|
|||
me.toolbar.render(_.extend({compactview: compactview}, config));
|
||||
|
||||
if ( config.isEdit ) {
|
||||
me.toolbar.setMode(config);
|
||||
|
||||
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
||||
var $panel = me.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
||||
if ( $panel )
|
||||
|
@ -2053,12 +2061,6 @@ define([
|
|||
this.toolbar.lockToolbar(PE.enumLock.noSlides, this._state.no_slides, { array: this.btnsComment });
|
||||
}
|
||||
}
|
||||
|
||||
Common.Utils.asyncCall(function () {
|
||||
if ( config.isEdit ) {
|
||||
me.toolbar.onAppReady(config);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
onFileMenu: function (opts) {
|
||||
|
|
|
@ -198,6 +198,14 @@ define([
|
|||
checkable: true,
|
||||
value: 'toolbar'
|
||||
});
|
||||
if (!config.isEdit) {
|
||||
me.header.mnuitemCompactToolbar.hide();
|
||||
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
||||
if (action=='plugins' && visible) {
|
||||
me.header.mnuitemCompactToolbar.show();
|
||||
}
|
||||
}, this));
|
||||
}
|
||||
|
||||
var mnuitemHideStatusBar = new Common.UI.MenuItem({
|
||||
caption: me.header.textHideStatusBar,
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
<div class="toolbar">
|
||||
<div class="box-tabs">
|
||||
<div class="extra left"></div>
|
||||
<section class="tabs">
|
||||
<a class="scroll left">
|
||||
<i class="icon"><</i>
|
||||
</a>
|
||||
<ul>
|
||||
<% for(var i in tabs) { %>
|
||||
<li class="ribtab<% if (tabs[i].extcls) print(' ' + tabs[i].extcls) %>">
|
||||
<a data-tab="<%= tabs[i].action %>" data-title="<%= tabs[i].caption %>"><%= tabs[i].caption %></a>
|
||||
</li>
|
||||
<% } %>
|
||||
</ul>
|
||||
<a class="scroll right">
|
||||
<i class="icon">></i>
|
||||
</a>
|
||||
</section>
|
||||
<div class="extra right">
|
||||
</div>
|
||||
</div>
|
||||
<section class="box-controls">
|
||||
<section class="box-panels">
|
||||
</section>
|
||||
</section>
|
||||
</div>
|
|
@ -179,7 +179,7 @@ define([
|
|||
} else {
|
||||
btn.panel['hide']();
|
||||
}
|
||||
if (this.mode.isEdit) PE.getController('Toolbar').DisableToolbar(state==true);
|
||||
PE.getController('Toolbar').DisableToolbar(state==true);
|
||||
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
||||
},
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue