diff --git a/apps/spreadsheeteditor/mobile/app/controller/Settings.js b/apps/spreadsheeteditor/mobile/app/controller/Settings.js index 309177f4f..fff456b6f 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Settings.js @@ -77,9 +77,10 @@ define([ }, setApi: function (api) { - var me = this; - me.api = api; - me.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(me.onSendThemeColorSchemes, me)); + this.api = api; + this.api.asc_registerCallback('asc_onSendThemeColorSchemes', _.bind(this.onSendThemeColorSchemes, this)); + this.api.asc_registerCallback('asc_onSheetsChanged', _.bind(this.sheetChanged, this)); + this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', _.bind(this.sheetChanged, this)); }, onLaunch: function () { @@ -167,9 +168,42 @@ define([ } else if ('#color-schemes-view' == pageId) { me.initPageColorSchemes(); Common.Utils.addScrollIfNeed('.page[data-page=color-schemes-view]', '.page[data-page=color-schemes-view] .page-content'); + } else if ('#settings-spreadsheet-view' == pageId) { + me.initSpreadsheetSettings(); } }, + initSpreadsheetSettings: function() { + var me = this, + $pageSpreadsheetSettings = $('.page[data-page=settings-spreadsheet-view]'), + $switchHideHeadings = $pageSpreadsheetSettings.find('#hide-headings input'), + $switchHideGridlines = $pageSpreadsheetSettings.find('#hide-gridlines input'); + + $switchHideHeadings.single('change', _.bind(me.clickCheckboxHideHeadings, me)); + $switchHideGridlines.single('change', _.bind(me.clickCheckboxHideGridlines, me)); + + var params = me.sheetChanged(); + $switchHideHeadings.prop('checked',!params.asc_getShowRowColHeaders()); + $switchHideGridlines.prop('checked',!params.asc_getShowGridLines()); + }, + + clickCheckboxHideHeadings: function(e) { + var $target = $(e.currentTarget), + checked = $target.prop('checked'); + this.api.asc_setDisplayHeadings(!checked); + }, + + clickCheckboxHideGridlines: function(e) { + var $target = $(e.currentTarget), + checked = $target.prop('checked'); + this.api.asc_setDisplayGridlines(!checked); + }, + + sheetChanged: function() { + var params = this.api.asc_getSheetViewSettings(); + return(params); + }, + initPageColorSchemes: function() { $('#color-schemes-content').html(templateInsert); $('.color-schemes-menu').on('click', _.bind(this.onColorSchemaClick, this)); diff --git a/apps/spreadsheeteditor/mobile/app/template/Settings.template b/apps/spreadsheeteditor/mobile/app/template/Settings.template index dc0b0ef85..3e2110442 100644 --- a/apps/spreadsheeteditor/mobile/app/template/Settings.template +++ b/apps/spreadsheeteditor/mobile/app/template/Settings.template @@ -417,7 +417,36 @@
- +
+
    +
  • +
    +
    +
    <%= scope.textHideHeadings %>
    +
    + +
    +
    +
    +
  • +
  • +
    +
    +
    <%= scope.textHideGridlines %>
    +
    + +
    +
    +
    +
  • +
+
  • diff --git a/apps/spreadsheeteditor/mobile/app/view/Settings.js b/apps/spreadsheeteditor/mobile/app/view/Settings.js index ee9cf3606..a636e0c68 100644 --- a/apps/spreadsheeteditor/mobile/app/view/Settings.js +++ b/apps/spreadsheeteditor/mobile/app/view/Settings.js @@ -247,7 +247,9 @@ define([ textPoint: 'Point', textInch: 'Inch', textSpreadsheetSettings: 'Spreadsheet Settings', - textColorSchemes: 'Color Schemes' + textColorSchemes: 'Color Schemes', + textHideHeadings: 'Hide Headings', + textHideGridlines: 'Hide Gridlines' } })(), SSE.Views.Settings || {})) }); \ No newline at end of file