diff --git a/apps/spreadsheeteditor/main/app/controller/ViewTab.js b/apps/spreadsheeteditor/main/app/controller/ViewTab.js index 3b441f76b8..00e5d842d7 100644 --- a/apps/spreadsheeteditor/main/app/controller/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/controller/ViewTab.js @@ -86,7 +86,8 @@ define([ 'viewtab:gridlines': this.onViewSettings, 'viewtab:zoom': this.onZoom, 'viewtab:showview': this.onShowView, - 'viewtab:openview': this.onOpenView + 'viewtab:openview': this.onOpenView, + 'viewtab:createview': this.onCreateView // 'viewtab:manager': this.onOpenManager }, 'Statusbar': { @@ -161,6 +162,10 @@ define([ this.api && this.api.asc_setActiveNamedSheetView((item.value == 'default') ? null : item.name); }, + onCreateView: function(item) { + this.api && this.api.asc_addNamedSheetView(); + }, + // onWorksheetLocked: function(index,locked) { // if (index == this.api.asc_getActiveWorksheetIndex()) { // Common.Utils.lockControls(SSE.enumLock.sheetLock, locked, {array: this.view.btnsSortDown.concat(this.view.btnsSortUp, this.view.btnCustomSort, this.view.btnGroup, this.view.btnUngroup)}); diff --git a/apps/spreadsheeteditor/main/app/view/ViewTab.js b/apps/spreadsheeteditor/main/app/view/ViewTab.js index 0e4232b179..1617c409b9 100644 --- a/apps/spreadsheeteditor/main/app/view/ViewTab.js +++ b/apps/spreadsheeteditor/main/app/view/ViewTab.js @@ -51,6 +51,12 @@ define([ me.btnFreezePanes.on('click', function (btn, e) { me.fireEvent('viewtab:freeze', [btn.pressed]); }); + 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'); + }); this.chFormula.on('change', function (field, value) { me.fireEvent('viewtab:formula', [0, value]); });