Skip to content

Commit

Permalink
[SSE] Set scroll settings from config
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Jan 31, 2025
1 parent 43af739 commit 14153f6
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/api/documents/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@
},
slidePlayerBackground: '#000000', // background color for slide show in presentation editor
wordHeadingsColor: '#00ff00' // set color for default heading styles in document editor
showVerticalScroll: true/false, // show/hide scroll in the spreadsheet editor by default
showHorizontalScroll: true/false // show/hide scroll in the spreadsheet editor by default
},
coEditing: {
mode: 'fast', // <coauthoring mode>, 'fast' or 'strict'. if 'fast' and 'customization.autosave'=false -> set 'customization.autosave'=true. 'fast' - default for editor
Expand Down
7 changes: 7 additions & 0 deletions apps/spreadsheeteditor/embed/js/ApplicationController.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,13 @@ SSE.ApplicationController = new(function(){
enable = !config.customization || (config.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);

if (config.customization) {
if (config.customization.showVerticalScroll!==undefined && config.customization.showVerticalScroll!==null)
docInfo.asc_putShowVerticalScroll(config.customization.showVerticalScroll);
if (config.customization.showHorizontalScroll!==undefined && config.customization.showHorizontalScroll!==null)
docInfo.asc_putShowHorizontalScroll(config.customization.showHorizontalScroll);
}

if (api) {
api.asc_registerCallback('asc_onGetEditorPermissions', onEditorPermissions);
api.asc_registerCallback('asc_onRunAutostartMacroses', onRunAutostartMacroses);
Expand Down
14 changes: 14 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,13 @@ define([
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);

if (this.editorConfig.customization) {
if (this.editorConfig.customization.showVerticalScroll!==undefined && this.editorConfig.customization.showVerticalScroll!==null)
docInfo.asc_putShowVerticalScroll(this.editorConfig.customization.showVerticalScroll);
if (this.editorConfig.customization.showHorizontalScroll!==undefined && this.editorConfig.customization.showHorizontalScroll!==null)
docInfo.asc_putShowHorizontalScroll(this.editorConfig.customization.showHorizontalScroll);
}

this.headerView && this.headerView.setDocumentCaption(data.doc.title);
Common.Utils.InternalSettings.set("sse-doc-info-key", data.doc.key);
}
Expand Down Expand Up @@ -3690,6 +3697,13 @@ define([
enable = !this.editorConfig.customization || (this.editorConfig.customization.plugins!==false);
docInfo.asc_putIsEnabledPlugins(!!enable);

if (this.editorConfig.customization) {
if (this.editorConfig.customization.showVerticalScroll!==undefined && this.editorConfig.customization.showVerticalScroll!==null)
docInfo.asc_putShowVerticalScroll(this.editorConfig.customization.showVerticalScroll);
if (this.editorConfig.customization.showHorizontalScroll!==undefined && this.editorConfig.customization.showHorizontalScroll!==null)
docInfo.asc_putShowHorizontalScroll(this.editorConfig.customization.showHorizontalScroll);
}

var coEditMode = !(this.editorConfig.coEditing && typeof this.editorConfig.coEditing == 'object') ? 'fast' : // fast by default
this.editorConfig.mode === 'view' && this.editorConfig.coEditing.change!==false ? 'fast' : // if can change mode in viewer - set fast for using live viewer
this.editorConfig.coEditing.mode || 'fast';
Expand Down

0 comments on commit 14153f6

Please sign in to comment.