[sse mobile] Add page orientation in Spreadsheet Settings

This commit is contained in:
Julia Svinareva 2019-04-22 14:12:16 +03:00
parent 054f8908a4
commit c7d7500386
4 changed files with 50 additions and 2 deletions

View file

@ -177,7 +177,8 @@ define([
var me = this, var me = this,
$pageSpreadsheetSettings = $('.page[data-page=settings-spreadsheet-view]'), $pageSpreadsheetSettings = $('.page[data-page=settings-spreadsheet-view]'),
$switchHideHeadings = $pageSpreadsheetSettings.find('#hide-headings input'), $switchHideHeadings = $pageSpreadsheetSettings.find('#hide-headings input'),
$switchHideGridlines = $pageSpreadsheetSettings.find('#hide-gridlines input'); $switchHideGridlines = $pageSpreadsheetSettings.find('#hide-gridlines input'),
$pageOrientation = $('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation]');
$switchHideHeadings.single('change', _.bind(me.clickCheckboxHideHeadings, me)); $switchHideHeadings.single('change', _.bind(me.clickCheckboxHideHeadings, me));
$switchHideGridlines.single('change', _.bind(me.clickCheckboxHideGridlines, me)); $switchHideGridlines.single('change', _.bind(me.clickCheckboxHideGridlines, me));
@ -185,6 +186,22 @@ define([
var params = me.sheetChanged(); var params = me.sheetChanged();
$switchHideHeadings.prop('checked',!params.asc_getShowRowColHeaders()); $switchHideHeadings.prop('checked',!params.asc_getShowRowColHeaders());
$switchHideGridlines.prop('checked',!params.asc_getShowGridLines()); $switchHideGridlines.prop('checked',!params.asc_getShowGridLines());
// Init orientation
var currentSheet = this.api.asc_getActiveWorksheetIndex(),
props = this.api.asc_getPageOptions(currentSheet),
opt = props.asc_getPageSetup();
if(Number(opt.asc_getOrientation()) === 0) {
$('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation][value="0"]').prop( "checked", true );
} else {
$('.page[data-page=settings-spreadsheet-view] input:radio[name=table-orientation][value="1"]').prop( "checked", true );
}
$pageOrientation.single('change', _.bind(me.onOrientationChange, me));
},
onOrientationChange: function(e) {
var value = $(e.currentTarget).attr('value');
this.api.asc_changePageOrient(Number(value) === Asc.c_oAscPageOrientation.PagePortrait, this.api.asc_getActiveWorksheetIndex());
}, },
clickCheckboxHideHeadings: function(e) { clickCheckboxHideHeadings: function(e) {

View file

@ -417,6 +417,29 @@
</div> </div>
<div class="page" id="page-settings-spreadsheet-view" data-page="settings-spreadsheet-view"> <div class="page" id="page-settings-spreadsheet-view" data-page="settings-spreadsheet-view">
<div class="page-content"> <div class="page-content">
<div class="content-block-title"><%= scope.textOrientation %></div>
<div class="list-block">
<ul>
<li>
<label class="label-radio item-content">
<input type="radio" name="table-orientation" value="0">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textPortrait %></div>
</div>
</label>
</li>
<li>
<label class="label-radio item-content">
<input type="radio" name="table-orientation" value="1">
<% if (android) { %><div class="item-media"><i class="icon icon-form-radio"></i></div><% } %>
<div class="item-inner">
<div class="item-title"><%= scope.textLandscape %></div>
</div>
</label>
</li>
</ul>
</div>
<div class="list-block"> <div class="list-block">
<ul> <ul>
<li id="hide-headings"> <li id="hide-headings">

View file

@ -249,7 +249,10 @@ define([
textSpreadsheetSettings: 'Spreadsheet Settings', textSpreadsheetSettings: 'Spreadsheet Settings',
textColorSchemes: 'Color Schemes', textColorSchemes: 'Color Schemes',
textHideHeadings: 'Hide Headings', textHideHeadings: 'Hide Headings',
textHideGridlines: 'Hide Gridlines' textHideGridlines: 'Hide Gridlines',
textOrientation: 'Orientation',
textPortrait: 'Portrait',
textLandscape: 'Landscape'
} }
})(), SSE.Views.Settings || {})) })(), SSE.Views.Settings || {}))
}); });

View file

@ -519,6 +519,11 @@
"SSE.Views.Settings.textInch": "Inch", "SSE.Views.Settings.textInch": "Inch",
"SSE.Views.Settings.textColorSchemes": "Color Schemes", "SSE.Views.Settings.textColorSchemes": "Color Schemes",
"SSE.Views.Settings.textSpreadsheetSettings": "Spreadsheet Settings", "SSE.Views.Settings.textSpreadsheetSettings": "Spreadsheet Settings",
"SSE.Views.Settings.textHideHeadings": "Hide Headings",
"SSE.Views.Settings.textHideGridlines": "Hide Gridlines",
"SSE.Views.Settings.textOrientation": "Orientation",
"SSE.Views.Settings.textPortrait": "Portrait",
"SSE.Views.Settings.textLandscape": "Landscape",
"SSE.Views.Settings.unknownText": "Unknown", "SSE.Views.Settings.unknownText": "Unknown",
"SSE.Views.Toolbar.textBack": "Back" "SSE.Views.Toolbar.textBack": "Back"
} }