From f30aefb614204619c1e55da9ee8b3e5d814a6d9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20Lyngs=C3=B8?= Date: Mon, 3 Jun 2019 12:04:14 +0200 Subject: [PATCH 1/3] parse dimensions to configuration of TinyMCE + remove autoresize if height is set. --- .../src/views/propertyeditors/rte/rte.controller.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 3c34890fa9..5bcd3b9330 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -41,10 +41,19 @@ angular.module("umbraco") $q.all(promises).then(function (result) { var standardConfig = result[promises.length - 1]; - + + var width = parseInt(editorConfig.dimensions.width, 10) || null + var height = parseInt(editorConfig.dimensions.height, 10) || null + + if (height !== null) { + standardConfig.plugins.splice(standardConfig.plugins.indexOf("autoresize"), 1); + } + //create a baseline Config to extend upon var baseLineConfigObj = { - maxImageSize: editorConfig.maxImageSize + maxImageSize: editorConfig.maxImageSize, + width: width, + height: height }; angular.extend(baseLineConfigObj, standardConfig); From 89670617582b7117e3119eb02c6f30f59661bbf5 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 5 Jun 2019 15:21:00 +1000 Subject: [PATCH 2/3] fixes semi colons --- .../src/views/propertyeditors/rte/rte.controller.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 5bcd3b9330..3f762007a0 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -42,8 +42,8 @@ angular.module("umbraco") var standardConfig = result[promises.length - 1]; - var width = parseInt(editorConfig.dimensions.width, 10) || null - var height = parseInt(editorConfig.dimensions.height, 10) || null + var width = parseInt(editorConfig.dimensions.width, 10) || null; + var height = parseInt(editorConfig.dimensions.height, 10) || null; if (height !== null) { standardConfig.plugins.splice(standardConfig.plugins.indexOf("autoresize"), 1); From 49c76c744e3e13f752bae5f6baed7de5a5633a10 Mon Sep 17 00:00:00 2001 From: Shannon Date: Wed, 5 Jun 2019 16:06:55 +1000 Subject: [PATCH 3/3] Fixes width/height for when in distraction free mode --- .../src/views/propertyeditors/rte/rte.controller.js | 10 +++++++--- .../src/views/propertyeditors/rte/rte.html | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js index 3f762007a0..d1fedf7db6 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.controller.js @@ -20,6 +20,13 @@ angular.module("umbraco") editorConfig.maxImageSize = tinyMceService.defaultPrevalues().maxImageSize; } + var width = parseInt(editorConfig.dimensions.width, 10) || null; + var height = parseInt(editorConfig.dimensions.height, 10) || null; + + $scope.containerWidth = editorConfig.mode === "distraction-free" ? (width ? width : "auto") : "auto"; + $scope.containerHeight = editorConfig.mode === "distraction-free" ? (height ? height : "auto") : "auto"; + $scope.containerOverflow = editorConfig.mode === "distraction-free" ? (height ? "auto" : "inherit") : "inherit"; + var promises = []; //queue file loading @@ -42,9 +49,6 @@ angular.module("umbraco") var standardConfig = result[promises.length - 1]; - var width = parseInt(editorConfig.dimensions.width, 10) || null; - var height = parseInt(editorConfig.dimensions.height, 10) || null; - if (height !== null) { standardConfig.plugins.splice(standardConfig.plugins.indexOf("autoresize"), 1); } diff --git a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html index a68bfe978e..7dde17bb06 100644 --- a/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html +++ b/src/Umbraco.Web.UI.Client/src/views/propertyeditors/rte/rte.html @@ -1,6 +1,6 @@
-