[SSE] Move views to paid features
This commit is contained in:
parent
54a589a29b
commit
ce19f6f1fc
|
@ -356,6 +356,7 @@ define([
|
|||
this.appOptions.mentionShare = !((typeof (this.appOptions.customization) == 'object') && (this.appOptions.customization.mentionShare==false));
|
||||
this.appOptions.canMakeActionLink = this.editorConfig.canMakeActionLink;
|
||||
this.appOptions.canFeaturePivot = !!this.api.asc_isSupportFeature("pivot-tables");
|
||||
this.appOptions.canFeatureViews = !!this.api.asc_isSupportFeature("sheet-views");
|
||||
|
||||
this.headerView = this.getApplication().getController('Viewport').getView('Common.Views.Header');
|
||||
this.headerView.setCanBack(this.appOptions.canBackToFolder === true, (this.appOptions.canBackToFolder) ? this.editorConfig.customization.goback.text : '')
|
||||
|
|
|
@ -3306,7 +3306,7 @@ define([
|
|||
}
|
||||
|
||||
var viewtab = me.getApplication().getController('ViewTab');
|
||||
viewtab.setApi(me.api).setConfig({toolbar: me});
|
||||
viewtab.setApi(me.api).setConfig({toolbar: me, mode: config});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,8 @@ define([
|
|||
setConfig: function(config) {
|
||||
this.toolbar = config.toolbar;
|
||||
this.view = this.createView('ViewTab', {
|
||||
toolbar: this.toolbar.toolbar
|
||||
toolbar: this.toolbar.toolbar,
|
||||
mode: config.mode
|
||||
});
|
||||
this.addListeners({
|
||||
'ViewTab': {
|
||||
|
|
|
@ -226,10 +226,10 @@
|
|||
<!--</div>-->
|
||||
</section>
|
||||
<section class="panel" data-tab="view">
|
||||
<div class="group">
|
||||
<div class="group sheet-views">
|
||||
<span class="btn-slot text x-huge" id="slot-btn-sheet-view"></span>
|
||||
</div>
|
||||
<div class="group" style="padding-left: 5px;">
|
||||
<div class="group sheet-views" style="padding-left: 5px;">
|
||||
<div class="elset">
|
||||
<span class="btn-slot text" id="slot-createview"></span>
|
||||
</div>
|
||||
|
@ -237,7 +237,7 @@
|
|||
<span class="btn-slot text" id="slot-closeview"></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="separator long"></div>
|
||||
<div class="separator long sheet-views"></div>
|
||||
<div class="group">
|
||||
<div class="elset" style="display: flex;">
|
||||
<span class="btn-slot" id="slot-field-zoom" style="flex-grow: 1;"></span>
|
||||
|
|
|
@ -48,15 +48,18 @@ define([
|
|||
SSE.Views.ViewTab = Common.UI.BaseView.extend(_.extend((function(){
|
||||
function setEvents() {
|
||||
var me = this;
|
||||
me.btnFreezePanes.on('click', function (btn, e) {
|
||||
me.fireEvent('viewtab:freeze', [btn.pressed]);
|
||||
});
|
||||
if ( me.appConfig.canFeatureViews ) {
|
||||
me.btnCloseView.on('click', function (btn, e) {
|
||||
me.fireEvent('viewtab:openview', [{name: 'default', value: 'default'}]);
|
||||
});
|
||||
me.btnCreateView.on('click', function (btn, e) {
|
||||
me.fireEvent('viewtab:createview');
|
||||
});
|
||||
}
|
||||
|
||||
me.btnFreezePanes.on('click', function (btn, e) {
|
||||
me.fireEvent('viewtab:freeze', [btn.pressed]);
|
||||
});
|
||||
this.chFormula.on('change', function (field, value) {
|
||||
me.fireEvent('viewtab:formula', [0, value]);
|
||||
});
|
||||
|
@ -77,6 +80,7 @@ define([
|
|||
initialize: function (options) {
|
||||
Common.UI.BaseView.prototype.initialize.call(this);
|
||||
this.toolbar = options.toolbar;
|
||||
this.appConfig = options.mode;
|
||||
|
||||
this.lockedControls = [];
|
||||
|
||||
|
@ -84,6 +88,7 @@ define([
|
|||
$host = me.toolbar.$el,
|
||||
_set = SSE.enumLock;
|
||||
|
||||
if ( me.appConfig.canFeatureViews ) {
|
||||
this.btnSheetView = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-sheet-view'),
|
||||
cls: 'btn-toolbar x-huge icon-top',
|
||||
|
@ -113,6 +118,7 @@ define([
|
|||
});
|
||||
this.lockedControls.push(this.btnCloseView);
|
||||
Common.Utils.injectComponent($host.find('#slot-closeview'), this.btnCloseView);
|
||||
}
|
||||
|
||||
this.btnFreezePanes = new Common.UI.Button({
|
||||
parentEl: $host.find('#slot-btn-freeze'),
|
||||
|
@ -180,11 +186,16 @@ define([
|
|||
(new Promise(function (accept, reject) {
|
||||
accept();
|
||||
})).then(function(){
|
||||
if (!config.canFeatureViews) {
|
||||
me.toolbar && me.toolbar.$el.find('.group.sheet-views').hide();
|
||||
me.toolbar && me.toolbar.$el.find('.separator.sheet-views').hide();
|
||||
} else {
|
||||
me.btnSheetView.updateHint( me.tipSheetView );
|
||||
me.setButtonMenu(me.btnSheetView);
|
||||
|
||||
me.btnCreateView.updateHint(me.tipCreate);
|
||||
me.btnCloseView.updateHint(me.tipClose);
|
||||
}
|
||||
me.btnFreezePanes.updateHint(me.tipFreeze);
|
||||
|
||||
setEvents.call(me);
|
||||
|
|
Loading…
Reference in a new issue