diff --git a/apps/common/main/lib/view/Header.js b/apps/common/main/lib/view/Header.js index ab6ccfc28..c04e84b2c 100644 --- a/apps/common/main/lib/view/Header.js +++ b/apps/common/main/lib/view/Header.js @@ -73,6 +73,7 @@ define([ '' + '<%= textSaveEnd %>' + '
' + + '
' + '
' + '
' + '
' + @@ -267,6 +268,12 @@ define([ me.fireEvent('print', me); }); } + + if ( me.btnEdit ) { + me.btnEdit.on('click', function (e) { + me.fireEvent('go:editor', me); + }); + } } } @@ -375,6 +382,13 @@ define([ this.btnPrint.render($html.find('#slot-hbtn-print')); } + + if ( config.canEdit && config.canRequestEditRights ) { + (this.btnEdit = new Common.UI.Button({ + cls: 'btn-header', + iconCls: 'svgicon svg-btn-edit' + })).render($html.find('#slot-hbtn-edit')); + } } if ( this.documentCaption ) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index c195596da..e4064fe1f 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -116,8 +116,12 @@ define([ 'Common.Views.Header': { 'print': this.onPrint.bind(this), 'downloadas': function (opts) { - this.api.asc_DownloadOrigin(); - }.bind(this) + // this.api.asc_DownloadOrigin(); + console.log('download original'); + }.bind(this), + 'go:editor': function() { + Common.Gateway.requestEditRights(); + } } }); diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 1d01ca13f..930fc3f24 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -123,6 +123,16 @@ define([ 'FileMenu': { 'menu:hide': this.onFileMenu.bind(this, 'hide'), 'menu:show': this.onFileMenu.bind(this, 'show') + }, + 'Common.Views.Header': { + 'print': this.onPrint.bind(this), + 'downloadas': function (opts) { + // this.api.asc_DownloadOrigin(); + console.log('download original'); + }.bind(this), + 'go:editor': function() { + Common.Gateway.requestEditRights(); + } } }); diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index c3ffc2acc..bc8591d53 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -77,6 +77,16 @@ define([ }, 'LeftMenu': { 'settings:apply': _.bind(this.applyFormulaSettings, this) + }, + 'Common.Views.Header': { + 'print': this.onPrint.bind(this), + 'downloadas': function (opts) { + // this.api.asc_DownloadOrigin(); + console.log('download original'); + }.bind(this), + 'go:editor': function() { + Common.Gateway.requestEditRights(); + } } }); this.editMode = true;