From cdd6cf7d3e8ec6c5244e2b06d25b3e0643d17372 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Tue, 22 Sep 2015 17:36:27 +0100 Subject: [PATCH] Fix over-sized editor pane widths closes #5804, supersedes and closes #5820 - adds a fixed width that flexbox can expand from to prevent flexbox content dictating the width (see https://github.com/TryGhost/Ghost/issues/5804#issuecomment-141416812) - adds a hack to the casperjs tests reverting the CSS change because phantomjs and flexbox don't get along --- core/client/app/styles/layouts/main.css | 5 +++++ core/test/functional/base.js | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/core/client/app/styles/layouts/main.css b/core/client/app/styles/layouts/main.css index c5f7beeb46..a360041928 100644 --- a/core/client/app/styles/layouts/main.css +++ b/core/client/app/styles/layouts/main.css @@ -24,6 +24,11 @@ background: #fff; } +/* Flexbox fix. https://github.com/TryGhost/Ghost/issues/5804#issuecomment-141416812 */ +.gh-main > section { + width: 1px; +} + /* Global Nav /* ---------------------------------------------------------- */ diff --git a/core/test/functional/base.js b/core/test/functional/base.js index c5d8f928fb..ee81987940 100644 --- a/core/test/functional/base.js +++ b/core/test/functional/base.js @@ -206,6 +206,12 @@ casper.thenOpenAndWaitForPageLoad = function (screen, then, timeout) { timeout = timeout || casper.failOnTimeout(casper.test, 'Unable to load ' + screen); return casper.thenOpen(url + screens[screen].url).then(function () { + // HACK: phantomjs + flexbox = nope. Fix offending styles here. + casper.evaluate(function () { + var style = document.createElement('style'); + style.innerHTML = '.gh-main > section { width: auto; }'; + document.body.appendChild(style); + }); return casper.waitForScreenLoad(screen, then, timeout); }); };