Merge pull request #5568 from umbraco/v8/bugfix/5565-rte-sizing

5565 fix for configuration of TineMCE size
This commit is contained in:
Shannon Deminick
2019-06-05 16:07:55 +10:00
committed by GitHub
2 changed files with 16 additions and 3 deletions

View File

@@ -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
@@ -41,10 +48,16 @@ angular.module("umbraco")
$q.all(promises).then(function (result) {
var standardConfig = result[promises.length - 1];
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);

View File

@@ -1,6 +1,6 @@
<div ng-controller="Umbraco.PropertyEditors.RTEController" class="umb-property-editor umb-rte">
<umb-load-indicator ng-if="isLoading"></umb-load-indicator>
<div ng-style="{ visibility : isLoading ? 'hidden' : 'visible'}"
<div ng-style="{ visibility : isLoading ? 'hidden' : 'visible', width :containerWidth, height: containerHeight, overflow: containerOverflow}"
id="{{textAreaHtmlId}}" class="umb-rte-editor"></div>
</div>