From 939c50e6fb2a0df6f3365ea23fd46d0e36ca2d0d Mon Sep 17 00:00:00 2001 From: Alexander Yuzhin Date: Mon, 21 Nov 2016 15:19:49 +0300 Subject: [PATCH] [DE mobile] Fixed top offset of workarea. --- apps/documenteditor/mobile/app/view/Toolbar.js | 18 +++++++++++++----- .../mobile/resources/css/app-ios.css | 5 +++++ .../mobile/resources/css/app-material.css | 5 +++++ .../mobile/resources/less/app-ios.less | 7 +++++++ .../mobile/resources/less/app-material.less | 7 +++++++ 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/mobile/app/view/Toolbar.js b/apps/documenteditor/mobile/app/view/Toolbar.js index d24de94b8..5b489f4f2 100644 --- a/apps/documenteditor/mobile/app/view/Toolbar.js +++ b/apps/documenteditor/mobile/app/view/Toolbar.js @@ -81,16 +81,19 @@ define([ // Render layout render: function() { - var $el = $(this.el); + var me = this, + $el = $(me.el); - $el.prepend(this.template({ + $el.prepend(me.template({ android : Common.SharedSettings.get('android'), phone : Common.SharedSettings.get('phone'), - backTitle : Common.SharedSettings.get('android') ? '' : this.textBack, - scope : this + backTitle : Common.SharedSettings.get('android') ? '' : me.textBack, + scope : me })); - return this; + $('.view-main .navbar').on('addClass removeClass', _.bind(me.onDisplayMainNavbar, me)); + + return me; }, setMode: function (mode) { @@ -101,6 +104,11 @@ define([ } }, + onDisplayMainNavbar: function (e) { + var $target = $(e.currentTarget); + $('#editor_sdk').css('marginTop', $target.hasClass('navbar-hidden') ? 0 : ''); + }, + // Search searchToggle: function() { if ($$('.searchbar.document').length > 0) { diff --git a/apps/documenteditor/mobile/resources/css/app-ios.css b/apps/documenteditor/mobile/resources/css/app-ios.css index 33a519ae9..d73bebdfa 100644 --- a/apps/documenteditor/mobile/resources/css/app-ios.css +++ b/apps/documenteditor/mobile/resources/css/app-ios.css @@ -6506,6 +6506,11 @@ i.icon.icon-link { height: 22px; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20viewBox%3D%220%200%2022%2022%22%20fill%3D%22%234066D7%22%3E%3Cg%3E%3Cpath%20d%3D%22M12.4%2C9.8c0%2C0-2.1-0.1-3.8%2C1.2c-2.8%2C2-3.3%2C4.3-3.3%2C4.3s1.6-1.7%2C3.5-2.5c1.7-0.7%2C3.7-0.4%2C3.7-0.4v1.9l4.8-3.3V11l-4.8-3.3V9.8z%20M11%2C1C5.5%2C1%2C1%2C5.5%2C1%2C11c0%2C5.5%2C4.5%2C10%2C10%2C10s10-4.5%2C10-10C21%2C5.5%2C16.5%2C1%2C11%2C1z%20M11%2C20c-5%2C0-9-4.1-9-9C2%2C6%2C6%2C2%2C11%2C2s9%2C4.1%2C9%2C9C20%2C16%2C16%2C20%2C11%2C20z%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"); } +#editor_sdk { + margin-top: 44px; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} #add-table .page, #add-shape .page { background-color: #fff; diff --git a/apps/documenteditor/mobile/resources/css/app-material.css b/apps/documenteditor/mobile/resources/css/app-material.css index 1fa873fc2..97d235724 100644 --- a/apps/documenteditor/mobile/resources/css/app-material.css +++ b/apps/documenteditor/mobile/resources/css/app-material.css @@ -6104,6 +6104,11 @@ textarea { -webkit-user-select: text; user-select: text; } +#editor_sdk { + margin-top: 48px; + -webkit-transition-duration: 300ms; + transition-duration: 300ms; +} #add-table .page, #add-shape .page { background-color: #fff; diff --git a/apps/documenteditor/mobile/resources/less/app-ios.less b/apps/documenteditor/mobile/resources/less/app-ios.less index 4ada68874..bc6d194ac 100644 --- a/apps/documenteditor/mobile/resources/less/app-ios.less +++ b/apps/documenteditor/mobile/resources/less/app-ios.less @@ -75,6 +75,13 @@ input, textarea { @import url('ios/_search.less'); @import url('ios/_icons.less'); +// Top offset + +#editor_sdk { + margin-top: @toolbarSize; + .transition(300ms); +} + // Add Container #add-table, diff --git a/apps/documenteditor/mobile/resources/less/app-material.less b/apps/documenteditor/mobile/resources/less/app-material.less index b2f7f1c29..7e54705fb 100644 --- a/apps/documenteditor/mobile/resources/less/app-material.less +++ b/apps/documenteditor/mobile/resources/less/app-material.less @@ -68,6 +68,13 @@ input, textarea { user-select:text; } +// Top offset + +#editor_sdk { + margin-top: @toolbarSize; + .transition(300ms); +} + // Add Container #add-table,