[SSE] Edit header/footer: click on canvas

This commit is contained in:
Julia Radzhabova 2018-10-24 16:11:58 +03:00
parent aff4b5d35c
commit 6446725dd5

View file

@ -261,6 +261,10 @@ define([
$window.find('.dlg-btn').on('click', _.bind(me.onBtnClick, me)); $window.find('.dlg-btn').on('click', _.bind(me.onBtnClick, me));
$window.find('#headerfooter-left-img').on('click', _.bind(me.onCanvasClick, me, '#headerfooter-left-img'));
$window.find('#headerfooter-center-img').on('click', _.bind(me.onCanvasClick, me, '#headerfooter-center-img'));
$window.find('#headerfooter-right-img').on('click', _.bind(me.onCanvasClick, me, '#headerfooter-right-img'));
this.scrollerYL = new Common.UI.Scroller({ this.scrollerYL = new Common.UI.Scroller({
el: this.$window.find('#headerfooter-left-img').parent(), el: this.$window.find('#headerfooter-left-img').parent(),
minScrollbarLength : 20 minScrollbarLength : 20
@ -297,8 +301,10 @@ define([
this.cmbFonts.fillFonts(this.fontStore); this.cmbFonts.fillFonts(this.fontStore);
this.cmbFonts.selectRecord(this.fontStore.findWhere({name: this.font.name}) || this.fontStore.at(0)); this.cmbFonts.selectRecord(this.fontStore.findWhere({name: this.font.name}) || this.fontStore.at(0));
this.signObject = new AscCommon.CSignatureDrawer('headerfooter-left-img', this.api, 50, 50); // this.signObject = new AscCommon.CSignatureDrawer('headerfooter-left-img', this.api, 50, 50);
// this.HFObject = new AscCommon.CHeaderDrawer('headerfooter-left-img', 'headerfooter-center-img', 'headerfooter-right-img'); this.HFObject = new AscCommonExcel.CHeaderFooterEditor('headerfooter-left-img', 'headerfooter-center-img', 'headerfooter-right-img', 190);
}, },
getSettings: function () { getSettings: function () {
@ -328,6 +334,10 @@ define([
this.scrollerYC.update(); this.scrollerYC.update();
}, },
onCanvasClick: function(id, event){
this.HFObject.click(id, event.pageX*Common.Utils.zoom(), event.pageY*Common.Utils.zoom());
},
cancelButtonText: 'Cancel', cancelButtonText: 'Cancel',
okButtonText: 'Ok', okButtonText: 'Ok',
tipFontName: 'Font Name', tipFontName: 'Font Name',