[Common] added button 'Edit Document' to 'preview' mode

This commit is contained in:
Maxim Kadushkin 2017-07-21 13:41:56 +03:00
parent ed09cac20b
commit 0a1324217e
4 changed files with 40 additions and 2 deletions

View file

@ -73,6 +73,7 @@ define([
'<label id="rib-doc-name" class="status-label"></label>' + '<label id="rib-doc-name" class="status-label"></label>' +
'<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' + '<a id="rib-save-status" class="status-label locked"><%= textSaveEnd %></a>' +
'<div class="hedset">' + '<div class="hedset">' +
'<div class="btn-slot" id="slot-hbtn-edit"></div>' +
'<div class="btn-slot" id="slot-hbtn-print"></div>' + '<div class="btn-slot" id="slot-hbtn-print"></div>' +
'<div class="btn-slot" id="slot-hbtn-download"></div>' + '<div class="btn-slot" id="slot-hbtn-download"></div>' +
'</div>' + '</div>' +
@ -267,6 +268,12 @@ define([
me.fireEvent('print', me); 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')); 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 ) { if ( this.documentCaption ) {

View file

@ -116,8 +116,12 @@ define([
'Common.Views.Header': { 'Common.Views.Header': {
'print': this.onPrint.bind(this), 'print': this.onPrint.bind(this),
'downloadas': function (opts) { 'downloadas': function (opts) {
this.api.asc_DownloadOrigin(); // this.api.asc_DownloadOrigin();
}.bind(this) console.log('download original');
}.bind(this),
'go:editor': function() {
Common.Gateway.requestEditRights();
}
} }
}); });

View file

@ -123,6 +123,16 @@ define([
'FileMenu': { 'FileMenu': {
'menu:hide': this.onFileMenu.bind(this, 'hide'), 'menu:hide': this.onFileMenu.bind(this, 'hide'),
'menu:show': this.onFileMenu.bind(this, 'show') '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();
}
} }
}); });

View file

@ -77,6 +77,16 @@ define([
}, },
'LeftMenu': { 'LeftMenu': {
'settings:apply': _.bind(this.applyFormulaSettings, this) '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; this.editMode = true;