From 56b5eb51dd035222fca4aec2333df5674405007f Mon Sep 17 00:00:00 2001 From: Ostap Kravchuk Date: Wed, 16 Jan 2019 18:13:13 +0100 Subject: [PATCH 1/3] Fix a bug with pane resizing after moving between tabs and switching side panels --- src/components/projecteditor/ProjectEditor.js | 2 +- src/components/projecteditor/panes.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/projecteditor/ProjectEditor.js b/src/components/projecteditor/ProjectEditor.js index 7cf9bb2a..43391da5 100644 --- a/src/components/projecteditor/ProjectEditor.js +++ b/src/components/projecteditor/ProjectEditor.js @@ -106,7 +106,7 @@ export default class ProjectEditor extends Component { onPanesSizeChange() { if (this.props.router.panes) { - this.props.router.panes.redraw(true); + this.props.router.panes.redraw(false); } } diff --git a/src/components/projecteditor/panes.js b/src/components/projecteditor/panes.js index d2473e2d..7596c9e6 100644 --- a/src/components/projecteditor/panes.js +++ b/src/components/projecteditor/panes.js @@ -284,6 +284,9 @@ class Panes extends Component { if (paneObj) { paneObj.style.display = 'block'; } + // visible pane should be drawn because of side panels + // which state is unknown to the pane + setTimeout(() => { pane.redraw(); }, 5); } else { var paneObj = document.getElementById(key); if (paneObj) paneObj.style.display = 'none'; From 96fe573af7419a199ef66009750cc5d644323f25 Mon Sep 17 00:00:00 2001 From: Ostap Kravchuk Date: Thu, 17 Jan 2019 15:32:24 +0100 Subject: [PATCH 2/3] Fix classnames types and *.less files import --- package.json | 1 + src/global.d.ts | 20 ++++++++++++++++++++ yarn.lock | 5 +++++ 3 files changed, 26 insertions(+) create mode 100644 src/global.d.ts diff --git a/package.json b/package.json index bac4b657..736d54a2 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "devDependencies": { "@babel/core": "7.1.0", "@svgr/webpack": "2.4.1", + "@types/classnames": "^2.2.7", "@types/react": "^16.7.18", "@types/react-dom": "^16.0.11", "@types/react-onclickoutside": "^6.7.0", diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 00000000..f8e925f4 --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1,20 @@ +// Copyright 2018 Superblocks AB +// +// This file is part of Superblocks Lab. +// +// Superblocks Lab is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation version 3 of the License. +// +// Superblocks Lab is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with Superblocks Lab. If not, see . + +declare module '*.less' { + const content: any; + export default content; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 44ae4356..dd408000 100644 --- a/yarn.lock +++ b/yarn.lock @@ -977,6 +977,11 @@ "@svgr/core" "^2.4.1" loader-utils "^1.1.0" +"@types/classnames@^2.2.7": + version "2.2.7" + resolved "https://registry.yarnpkg.com/@types/classnames/-/classnames-2.2.7.tgz#fb68cc9be8487e6ea5b13700e759bfbab7e0fefd" + integrity sha512-rzOhiQ55WzAiFgXRtitP/ZUT8iVNyllEpylJ5zHzR4vArUvMB39GTk+Zon/uAM0JxEFAWnwsxC2gH8s+tZ3Myg== + "@types/history@*": version "4.7.2" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.2.tgz#0e670ea254d559241b6eeb3894f8754991e73220" From cf65f5d49034a35a6efe6c783e5660947623eafe Mon Sep 17 00:00:00 2001 From: Ostap Kravchuk Date: Thu, 17 Jan 2019 15:38:00 +0100 Subject: [PATCH 3/3] new line --- src/global.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/global.d.ts b/src/global.d.ts index f8e925f4..170ab5b1 100644 --- a/src/global.d.ts +++ b/src/global.d.ts @@ -17,4 +17,4 @@ declare module '*.less' { const content: any; export default content; -} \ No newline at end of file +}