[DE] Show File and Plugins tabs in view mode
This commit is contained in:
parent
52029b5d19
commit
869bc1a7a6
|
@ -94,7 +94,7 @@ define([
|
||||||
$(document.body).on('click', onClickDocument.bind(this));
|
$(document.body).on('click', onClickDocument.bind(this));
|
||||||
|
|
||||||
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
Common.NotificationCenter.on('tab:visible', _.bind(function(action, visible){
|
||||||
this.setVisible(action, visible)
|
this.setVisible(action, visible);
|
||||||
}, this));
|
}, this));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ define([
|
||||||
return t.length && t.data('tab') == tag;
|
return t.length && t.data('tab') == tag;
|
||||||
},
|
},
|
||||||
|
|
||||||
setFolded: function(value) {
|
setFolded: function(value, defNum) {
|
||||||
this.isFolded = value;
|
this.isFolded = value;
|
||||||
|
|
||||||
var me = this;
|
var me = this;
|
||||||
|
@ -178,6 +178,9 @@ define([
|
||||||
if ( active_panel.length ) {
|
if ( active_panel.length ) {
|
||||||
var tab = active_panel.data('tab');
|
var tab = active_panel.data('tab');
|
||||||
me.$tabs.find('> a[data-tab=' + tab + ']').parent().toggleClass('active', true);
|
me.$tabs.find('> a[data-tab=' + tab + ']').parent().toggleClass('active', true);
|
||||||
|
} else if (defNum!==undefined && defNum<me.$tabs.length) {
|
||||||
|
var t = $(me.$tabs[defNum]).find('> a');
|
||||||
|
t.length && me.setTab(t.data('tab'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -278,6 +281,8 @@ define([
|
||||||
|
|
||||||
if ($target.length) {
|
if ($target.length) {
|
||||||
$target.after(panel);
|
$target.after(panel);
|
||||||
|
} else {
|
||||||
|
panel.appendTo(this.$layout.find('.box-panels'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ define([
|
||||||
'render:before' : function (toolbar) {
|
'render:before' : function (toolbar) {
|
||||||
var appOptions = me.getApplication().getController('Main').appOptions;
|
var appOptions = me.getApplication().getController('Main').appOptions;
|
||||||
|
|
||||||
if ( appOptions.isEdit && !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
|
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram ) {
|
||||||
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption};
|
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption};
|
||||||
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
|
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
|
||||||
|
|
||||||
|
|
|
@ -484,9 +484,8 @@ define([
|
||||||
|
|
||||||
if ( config.canEdit && config.canRequestEditRights )
|
if ( config.canEdit && config.canRequestEditRights )
|
||||||
this.btnEdit = createTitleButton('svg-btn-edit', $html.find('#slot-hbtn-edit'));
|
this.btnEdit = createTitleButton('svg-btn-edit', $html.find('#slot-hbtn-edit'));
|
||||||
} else {
|
|
||||||
me.btnOptions.render($html.find('#slot-btn-options'));
|
|
||||||
}
|
}
|
||||||
|
me.btnOptions.render($html.find('#slot-btn-options'));
|
||||||
|
|
||||||
$userList = $html.find('.cousers-list');
|
$userList = $html.find('.cousers-list');
|
||||||
$panelUsers = $html.find('.box-cousers');
|
$panelUsers = $html.find('.box-cousers');
|
||||||
|
|
|
@ -622,7 +622,7 @@ define([
|
||||||
}
|
}
|
||||||
application.getController('DocumentHolder').getView().focus();
|
application.getController('DocumentHolder').getView().focus();
|
||||||
|
|
||||||
if (this.api && !toolbarView._state.previewmode) {
|
if (this.api && this.appOptions.isEdit && !toolbarView._state.previewmode) {
|
||||||
var cansave = this.api.asc_isDocumentCanSave(),
|
var cansave = this.api.asc_isDocumentCanSave(),
|
||||||
forcesave = this.appOptions.forcesave,
|
forcesave = this.appOptions.forcesave,
|
||||||
isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.$icon.hasClass('btn-synch') : false,
|
isSyncButton = (toolbarView.btnCollabChanges.rendered) ? toolbarView.btnCollabChanges.$icon.hasClass('btn-synch') : false,
|
||||||
|
@ -1140,7 +1140,8 @@ define([
|
||||||
viewport = app.getController('Viewport').getView('Viewport'),
|
viewport = app.getController('Viewport').getView('Viewport'),
|
||||||
// headerView = app.getController('Viewport').getView('Common.Views.Header'),
|
// headerView = app.getController('Viewport').getView('Common.Views.Header'),
|
||||||
statusbarView = app.getController('Statusbar').getView('Statusbar'),
|
statusbarView = app.getController('Statusbar').getView('Statusbar'),
|
||||||
documentHolder = app.getController('DocumentHolder').getView();
|
documentHolder = app.getController('DocumentHolder').getView(),
|
||||||
|
toolbarController = app.getController('Toolbar');
|
||||||
|
|
||||||
// if (headerView) {
|
// if (headerView) {
|
||||||
// headerView.setHeaderCaption(this.appOptions.isEdit ? 'Document Editor' : 'Document Viewer');
|
// headerView.setHeaderCaption(this.appOptions.isEdit ? 'Document Editor' : 'Document Viewer');
|
||||||
|
@ -1149,7 +1150,7 @@ define([
|
||||||
|
|
||||||
viewport && viewport.setMode(this.appOptions);
|
viewport && viewport.setMode(this.appOptions);
|
||||||
statusbarView && statusbarView.setMode(this.appOptions);
|
statusbarView && statusbarView.setMode(this.appOptions);
|
||||||
|
toolbarController.setMode(this.appOptions);
|
||||||
documentHolder.setMode(this.appOptions);
|
documentHolder.setMode(this.appOptions);
|
||||||
|
|
||||||
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
this.api.asc_registerCallback('asc_onSendThemeColors', _.bind(this.onSendThemeColors, this));
|
||||||
|
@ -1187,20 +1188,17 @@ define([
|
||||||
|
|
||||||
viewport.applyEditorMode();
|
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() : null;
|
var toolbarView = (toolbarController) ? toolbarController.getView() : 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) {
|
if (toolbarView) {
|
||||||
|
toolbarView.setApi(me.api);
|
||||||
|
toolbarView.on('editcomplete', _.bind(me.onEditComplete, me));
|
||||||
toolbarView.on('insertimage', _.bind(me.onInsertImage, me));
|
toolbarView.on('insertimage', _.bind(me.onInsertImage, me));
|
||||||
toolbarView.on('inserttable', _.bind(me.onInsertTable, me));
|
toolbarView.on('inserttable', _.bind(me.onInsertTable, me));
|
||||||
toolbarView.on('insertshape', _.bind(me.onInsertShape, me));
|
toolbarView.on('insertshape', _.bind(me.onInsertShape, me));
|
||||||
|
|
|
@ -226,6 +226,11 @@ define([
|
||||||
Common.NotificationCenter.on('app:face', me.onAppShowed.bind(me));
|
Common.NotificationCenter.on('app:face', me.onAppShowed.bind(me));
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setMode: function(mode) {
|
||||||
|
this.mode = mode;
|
||||||
|
this.toolbar.applyLayout(mode);
|
||||||
|
},
|
||||||
|
|
||||||
attachUIEvents: function(toolbar) {
|
attachUIEvents: function(toolbar) {
|
||||||
/**
|
/**
|
||||||
* UI Events
|
* UI Events
|
||||||
|
@ -359,7 +364,7 @@ define([
|
||||||
},
|
},
|
||||||
|
|
||||||
onChangeCompactView: function(view, compact) {
|
onChangeCompactView: function(view, compact) {
|
||||||
this.toolbar.setFolded(compact);
|
this.toolbar.setFolded(compact, 1);
|
||||||
this.toolbar.fireEvent('view:compact', [this, compact]);
|
this.toolbar.fireEvent('view:compact', [this, compact]);
|
||||||
|
|
||||||
Common.localStorage.setBool('de-compact-toolbar', compact);
|
Common.localStorage.setBool('de-compact-toolbar', compact);
|
||||||
|
@ -2700,6 +2705,8 @@ define([
|
||||||
me.toolbar.render(_.extend({isCompactView: compactview}, config));
|
me.toolbar.render(_.extend({isCompactView: compactview}, config));
|
||||||
|
|
||||||
if ( config.isEdit ) {
|
if ( config.isEdit ) {
|
||||||
|
me.toolbar.setMode(config);
|
||||||
|
|
||||||
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
var tab = {action: 'review', caption: me.toolbar.textTabCollaboration};
|
||||||
var $panel = this.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
var $panel = this.getApplication().getController('Common.Controllers.ReviewChanges').createToolbarPanel();
|
||||||
|
|
||||||
|
|
|
@ -195,6 +195,14 @@ define([
|
||||||
checkable: true,
|
checkable: true,
|
||||||
value: 'toolbar'
|
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({
|
var mnuitemHideStatusBar = new Common.UI.MenuItem({
|
||||||
caption: me.header.textHideStatusBar,
|
caption: me.header.textHideStatusBar,
|
||||||
|
|
26
apps/documenteditor/main/app/template/ToolbarView.template
Normal file
26
apps/documenteditor/main/app/template/ToolbarView.template
Normal file
|
@ -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>
|
|
@ -183,7 +183,7 @@ define([
|
||||||
} else {
|
} else {
|
||||||
btn.panel['hide']();
|
btn.panel['hide']();
|
||||||
}
|
}
|
||||||
if (this.mode.isEdit) DE.getController('Toolbar').DisableToolbar(state==true);
|
DE.getController('Toolbar').DisableToolbar(state==true);
|
||||||
if (!this.supressEvents)
|
if (!this.supressEvents)
|
||||||
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
Common.NotificationCenter.trigger('layout:changed', 'leftmenu');
|
||||||
},
|
},
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue