[sse mobile] Add page orientation in Spreadsheet Settings
This commit is contained in:
parent
054f8908a4
commit
c7d7500386
|
@ -177,7 +177,8 @@ define([
|
|||
var me = this,
|
||||
$pageSpreadsheetSettings = $('.page[data-page=settings-spreadsheet-view]'),
|
||||
$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));
|
||||
$switchHideGridlines.single('change', _.bind(me.clickCheckboxHideGridlines, me));
|
||||
|
@ -185,6 +186,22 @@ define([
|
|||
var params = me.sheetChanged();
|
||||
$switchHideHeadings.prop('checked',!params.asc_getShowRowColHeaders());
|
||||
$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) {
|
||||
|
|
|
@ -417,6 +417,29 @@
|
|||
</div>
|
||||
<div class="page" id="page-settings-spreadsheet-view" data-page="settings-spreadsheet-view">
|
||||
<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">
|
||||
<ul>
|
||||
<li id="hide-headings">
|
||||
|
|
|
@ -249,7 +249,10 @@ define([
|
|||
textSpreadsheetSettings: 'Spreadsheet Settings',
|
||||
textColorSchemes: 'Color Schemes',
|
||||
textHideHeadings: 'Hide Headings',
|
||||
textHideGridlines: 'Hide Gridlines'
|
||||
textHideGridlines: 'Hide Gridlines',
|
||||
textOrientation: 'Orientation',
|
||||
textPortrait: 'Portrait',
|
||||
textLandscape: 'Landscape'
|
||||
}
|
||||
})(), SSE.Views.Settings || {}))
|
||||
});
|
|
@ -519,6 +519,11 @@
|
|||
"SSE.Views.Settings.textInch": "Inch",
|
||||
"SSE.Views.Settings.textColorSchemes": "Color Schemes",
|
||||
"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.Toolbar.textBack": "Back"
|
||||
}
|
Loading…
Reference in a new issue