From ef6285f32b09376dbe43dbbb562194a52340f688 Mon Sep 17 00:00:00 2001 From: Maxim Kadushkin Date: Wed, 7 Dec 2016 14:35:24 +0300 Subject: [PATCH] [SSE mobile] debug toolbar hidding on android --- .../spreadsheeteditor/mobile/app/controller/Editor.js | 5 +++++ .../mobile/app/controller/edit/EditContainer.js | 2 ++ .../mobile/resources/less/app-common.less | 11 +++++++++++ .../mobile/resources/less/app-material.less | 9 +++++++++ .../mobile/resources/less/ios/_search.less | 11 ----------- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Editor.js b/apps/spreadsheeteditor/mobile/app/controller/Editor.js index 7ca1c5ab7..725cc06cc 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Editor.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Editor.js @@ -102,6 +102,11 @@ define([ this.editorView = this.createView('Editor').render(); $$(window).on('resize', _.bind(this.onWindowResize, this)); + Common.NotificationCenter.on('layout:changed', (source, args) => { + if ( source == 'navbar' ) { + this.editorView.$el.find('.page.editor')[args.hidden?'addClass':'removeClass']('no-padding'); + } + }); }, onWindowResize: function(e) { diff --git a/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js b/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js index f8b008f16..183a1daae 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js +++ b/apps/spreadsheeteditor/mobile/app/controller/edit/EditContainer.js @@ -256,8 +256,10 @@ define([ '' )).on('close', function (e) { mainView.showNavbar(); + Common.NotificationCenter.trigger('layout:changed','navbar', {hidden:false}); }); mainView.hideNavbar(); + Common.NotificationCenter.trigger('layout:changed','navbar', {hidden:true}); } else { me.picker = uiApp.popover( '
' + diff --git a/apps/spreadsheeteditor/mobile/resources/less/app-common.less b/apps/spreadsheeteditor/mobile/resources/less/app-common.less index 37cb230bc..5b61dda4e 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/app-common.less +++ b/apps/spreadsheeteditor/mobile/resources/less/app-common.less @@ -4,6 +4,17 @@ .navbar-through { > .page.editor { padding-top: @appToolbarHeight; + transition: padding-top .2s ease-in; + } +} + +.navbar-through .page { + & > .searchbar { + top: @appToolbarHeight + @cellEditorHeight; + } + + #cell-editing-box.expanded + .searchbar { + top: @appToolbarHeight + @cellEditorExpandedHeight; } } diff --git a/apps/spreadsheeteditor/mobile/resources/less/app-material.less b/apps/spreadsheeteditor/mobile/resources/less/app-material.less index c5b05e603..499ae1d15 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/app-material.less +++ b/apps/spreadsheeteditor/mobile/resources/less/app-material.less @@ -173,3 +173,12 @@ input, textarea { } } } + +.phone { + .page.editor { + &.no-padding { + padding-top: 0; + transition: padding-top .2s ease-in; + } + } +} \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/resources/less/ios/_search.less b/apps/spreadsheeteditor/mobile/resources/less/ios/_search.less index fa91c4f76..d3e5e0382 100644 --- a/apps/spreadsheeteditor/mobile/resources/less/ios/_search.less +++ b/apps/spreadsheeteditor/mobile/resources/less/ios/_search.less @@ -1,16 +1,5 @@ // Search -.navbar-through .page { - & > .searchbar { - top: @toolbarSize + @cellEditorHeight; - //position: relative; - } - - #cell-editing-box.expanded + .searchbar { - top: @toolbarSize + @cellEditorHeightExp; - } -} - .tablet { // Replace mode .searchbar.document.replace {