Merge branch 'develop' into refactor

This commit is contained in:
Julia Radzhabova 2016-09-02 15:42:23 +03:00
commit a84fd57c3d
3 changed files with 8 additions and 6 deletions

View file

@ -765,7 +765,7 @@ define([
onApiZoomChange: function(percent, type) {
this.toolbar.btnFitPage.setChecked(type == 2, true);
this.toolbar.btnFitWidth.setChecked(type == 1, true);
this.toolbar.mnuZoom.options.value = percent;
$('.menu-zoom .zoom', this.toolbar.el).html(percent + '%');
},

View file

@ -748,6 +748,7 @@ define([
isChecked: function () { return this.conf.checked; }
};
this.btnFitWidth = _.clone(this.btnFitPage);
this.mnuZoom = {options: {value: 100}};
this.btnAdvSettings = new Common.UI.Button({
id : 'id-toolbar-btn-settings',
@ -1169,7 +1170,7 @@ define([
checkable: true,
checked: this.btnFitWidth.isChecked()
}),
(new Common.UI.MenuItem({
this.mnuZoom = new Common.UI.MenuItem({
template: _.template([
'<div id="id-toolbar-menu-zoom" class="menu-zoom" style="height: 25px;" ',
'<% if(!_.isUndefined(options.stopPropagation)) { %>',
@ -1177,12 +1178,13 @@ define([
'<% } %>', '>',
'<label class="title">' + this.textZoom + '</label>',
'<button id="id-menu-zoom-in" type="button" style="float:right; margin: 2px 5px 0 0;" class="btn small btn-toolbar"><span class="btn-icon btn-zoomin">&nbsp;</span></button>',
'<label class="zoom">100%</label>',
'<label class="zoom"><%= options.value %>%</label>',
'<button id="id-menu-zoom-out" type="button" style="float:right; margin-top: 2px;" class="btn small btn-toolbar"><span class="btn-icon btn-zoomout">&nbsp;</span></button>',
'</div>'
].join('')),
stopPropagation: true
}))
stopPropagation: true,
value: this.mnuZoom.options.value
})
]
})
);

View file

@ -270,6 +270,7 @@ define([
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onApiCoAuthoringDisconnect, this));
Common.NotificationCenter.on('api:disconnect', _.bind(this.onApiCoAuthoringDisconnect, this));
this.api.asc_registerCallback('asc_onLockDefNameManager', _.bind(this.onLockDefNameManager, this));
this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this));
},
onNewDocument: function(btn, e) {
@ -1159,7 +1160,6 @@ define([
this.api.asc_registerCallback('asc_onCanRedoChanged', _.bind(this.onApiCanRevert, this, 'redo'));
this.api.asc_registerCallback('asc_onEditCell', _.bind(this.onApiEditCell, this));
this.api.asc_registerCallback('asc_onEndAddShape', _.bind(this.onApiEndAddShape, this));
this.api.asc_registerCallback('asc_onZoomChanged', _.bind(this.onApiZoomChange, this));
this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.onApiSheetChanged, this));
this.api.asc_registerCallback('asc_onStopFormatPainter', _.bind(this.onApiStyleChange, this));
this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', _.bind(this.onApiSheetChanged, this));