Commit 35d21fdb authored by Julia Radzhabova's avatar Julia Radzhabova

Load initial zoom value from editor config.

parent 6cf46f44
...@@ -105,7 +105,8 @@ ...@@ -105,7 +105,8 @@
text: 'Go to London' text: 'Go to London'
}, },
chat: false, chat: false,
comments: false comments: false,
zoom: 100
}, },
plugins: { plugins: {
url: '../../../../sdkjs-plugins/', url: '../../../../sdkjs-plugins/',
......
...@@ -748,7 +748,8 @@ define([ ...@@ -748,7 +748,8 @@ define([
/** coauthoring end **/ /** coauthoring end **/
value = Common.localStorage.getItem("de-settings-zoom"); value = Common.localStorage.getItem("de-settings-zoom");
this.api.zoom((value!==null) ? parseInt(value) : 100); var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : 100);
(zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
value = Common.localStorage.getItem("de-show-hiddenchars"); value = Common.localStorage.getItem("de-show-hiddenchars");
me.api.put_ShowParaMarks((value!==null) ? eval(value) : false); me.api.put_ShowParaMarks((value!==null) ? eval(value) : false);
......
...@@ -210,7 +210,10 @@ define([ ...@@ -210,7 +210,10 @@ define([
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [ data : [
{ value: -1, displayValue: this.txtFitPage },
{ value: -2, displayValue: this.txtFitWidth },
{ value: 50, displayValue: "50%" }, { value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" }, { value: 60, displayValue: "60%" },
{ value: 70, displayValue: "70%" }, { value: 70, displayValue: "70%" },
...@@ -321,8 +324,9 @@ define([ ...@@ -321,8 +324,9 @@ define([
this.chInputMode.setValue(value!==null && parseInt(value) == 1); this.chInputMode.setValue(value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("de-settings-zoom"); value = Common.localStorage.getItem("de-settings-zoom");
var item = this.cmbZoom.store.findWhere({value: parseInt(value)}); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100); var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("de-settings-livecomment"); value = Common.localStorage.getItem("de-settings-livecomment");
...@@ -432,7 +436,9 @@ define([ ...@@ -432,7 +436,9 @@ define([
strStrict: 'Strict', strStrict: 'Strict',
textAutoRecover: 'Autorecover', textAutoRecover: 'Autorecover',
strAutoRecover: 'Turn on autorecover', strAutoRecover: 'Turn on autorecover',
txtInch: 'Inch' txtInch: 'Inch',
txtFitPage: 'Fit Page',
txtFitWidth: 'Fit Width'
}, DE.Views.FileMenuPanels.Settings || {})); }, DE.Views.FileMenuPanels.Settings || {}));
DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ DE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
......
...@@ -930,6 +930,8 @@ ...@@ -930,6 +930,8 @@
"DE.Views.FileMenuPanels.Settings.txtPt": "Point", "DE.Views.FileMenuPanels.Settings.txtPt": "Point",
"DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking", "DE.Views.FileMenuPanels.Settings.txtSpellCheck": "Spell Checking",
"DE.Views.FileMenuPanels.Settings.txtWin": "as Windows", "DE.Views.FileMenuPanels.Settings.txtWin": "as Windows",
"DE.Views.FileMenuPanels.Settings.txtFitPage": "Fit Page",
"DE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit Width",
"DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom Center", "DE.Views.HeaderFooterSettings.textBottomCenter": "Bottom Center",
"DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom Left", "DE.Views.HeaderFooterSettings.textBottomLeft": "Bottom Left",
"DE.Views.HeaderFooterSettings.textBottomRight": "Bottom Right", "DE.Views.HeaderFooterSettings.textBottomRight": "Bottom Right",
......
...@@ -558,8 +558,8 @@ define([ ...@@ -558,8 +558,8 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = Common.localStorage.getItem("pe-settings-zoom"); value = Common.localStorage.getItem("pe-settings-zoom");
var zf = (value!==null) ? parseInt(value) : -1; var zf = (value!==null) ? parseInt(value) : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom) : -1);
(zf == -1) ? this.api.zoomFitToPage() : this.api.zoom(zf); (zf == -1) ? this.api.zoomFitToPage() : ((zf == -2) ? this.api.zoomFitToWidth() : this.api.zoom(zf>0 ? zf : 100));
function checkWarns() { function checkWarns() {
if (!window['AscDesktopEditor']) { if (!window['AscDesktopEditor']) {
......
...@@ -164,8 +164,10 @@ define([ ...@@ -164,8 +164,10 @@ define([
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [ data : [
{ value: -1, displayValue: this.txtFitSlide }, { value: -1, displayValue: this.txtFitSlide },
{ value: -2, displayValue: this.txtFitWidth },
{ value: 50, displayValue: "50%" }, { value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" }, { value: 60, displayValue: "60%" },
{ value: 70, displayValue: "70%" }, { value: 70, displayValue: "70%" },
...@@ -267,9 +269,9 @@ define([ ...@@ -267,9 +269,9 @@ define([
this.chInputMode.setValue(value!==null && parseInt(value) == 1); this.chInputMode.setValue(value!==null && parseInt(value) == 1);
value = Common.localStorage.getItem("pe-settings-zoom"); value = Common.localStorage.getItem("pe-settings-zoom");
value = (value!==null) ? parseInt(value) : -1; value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : -1);
var item = this.cmbZoom.store.findWhere({value: value}); var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100); this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("pe-settings-coauthmode"); value = Common.localStorage.getItem("pe-settings-coauthmode");
...@@ -337,7 +339,8 @@ define([ ...@@ -337,7 +339,8 @@ define([
strStrict: 'Strict', strStrict: 'Strict',
textAutoRecover: 'Autorecover', textAutoRecover: 'Autorecover',
strAutoRecover: 'Turn on autorecover', strAutoRecover: 'Turn on autorecover',
txtInch: 'Inch' txtInch: 'Inch',
txtFitWidth: 'Fit Width'
}, PE.Views.FileMenuPanels.Settings || {})); }, PE.Views.FileMenuPanels.Settings || {}));
PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({ PE.Views.FileMenuPanels.RecentFiles = Common.UI.BaseView.extend({
......
...@@ -382,6 +382,7 @@ ...@@ -382,6 +382,7 @@
"PE.Views.FileMenuPanels.Settings.txtAll": "View All", "PE.Views.FileMenuPanels.Settings.txtAll": "View All",
"PE.Views.FileMenuPanels.Settings.txtCm": "Centimeter", "PE.Views.FileMenuPanels.Settings.txtCm": "Centimeter",
"PE.Views.FileMenuPanels.Settings.txtFitSlide": "Fit Slide", "PE.Views.FileMenuPanels.Settings.txtFitSlide": "Fit Slide",
"PE.Views.FileMenuPanels.Settings.txtFitWidth": "Fit Width",
"PE.Views.FileMenuPanels.Settings.txtInch": "Inch", "PE.Views.FileMenuPanels.Settings.txtInch": "Inch",
"PE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input", "PE.Views.FileMenuPanels.Settings.txtInput": "Alternate Input",
"PE.Views.FileMenuPanels.Settings.txtLast": "View Last", "PE.Views.FileMenuPanels.Settings.txtLast": "View Last",
......
...@@ -556,7 +556,8 @@ define([ ...@@ -556,7 +556,8 @@ define([
me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument); me.onLongActionEnd(Asc.c_oAscAsyncActionType['BlockInteraction'], LoadingDocument);
value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? 100 : Common.localStorage.getItem("sse-settings-zoom"); value = (this.appOptions.isEditMailMerge || this.appOptions.isEditDiagram) ? 100 : Common.localStorage.getItem("sse-settings-zoom");
this.api.asc_setZoom(!value?1:parseInt(value)/100); var zf = (value!==null) ? parseInt(value)/100 : (this.appOptions.customization && this.appOptions.customization.zoom ? parseInt(this.appOptions.customization.zoom)/100 : 1);
this.api.asc_setZoom(zf>0 ? zf : 1);
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("sse-settings-livecomment"); value = Common.localStorage.getItem("sse-settings-livecomment");
......
...@@ -523,6 +523,7 @@ define([ ...@@ -523,6 +523,7 @@ define([
style : 'width: 160px;', style : 'width: 160px;',
editable : false, editable : false,
cls : 'input-group-nr', cls : 'input-group-nr',
menuStyle : 'max-height: 210px;',
data : [ data : [
{ value: 50, displayValue: "50%" }, { value: 50, displayValue: "50%" },
{ value: 60, displayValue: "60%" }, { value: 60, displayValue: "60%" },
...@@ -660,8 +661,9 @@ define([ ...@@ -660,8 +661,9 @@ define([
updateSettings: function() { updateSettings: function() {
var value = Common.localStorage.getItem("sse-settings-zoom"); var value = Common.localStorage.getItem("sse-settings-zoom");
var item = this.cmbZoom.store.findWhere({value: parseInt(value)}); value = (value!==null) ? parseInt(value) : (this.mode.customization && this.mode.customization.zoom ? parseInt(this.mode.customization.zoom) : 100);
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : 100); var item = this.cmbZoom.store.findWhere({value: value});
this.cmbZoom.setValue(item ? parseInt(item.get('value')) : (value>0 ? value+'%' : 100));
/** coauthoring begin **/ /** coauthoring begin **/
value = Common.localStorage.getItem("sse-settings-livecomment"); value = Common.localStorage.getItem("sse-settings-livecomment");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment