From b8e23e6a4f7f8b15d3f04902f9d826d7b70bb702 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Wed, 11 Oct 2017 12:22:23 +0200 Subject: [PATCH] Fixed indention of inserted paragraphes --- openslides/core/static/js/core/pdf.js | 8 +++++++- openslides/motions/static/js/motions/base.js | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/openslides/core/static/js/core/pdf.js b/openslides/core/static/js/core/pdf.js index 7c0fc5761..4ea58996c 100644 --- a/openslides/core/static/js/core/pdf.js +++ b/openslides/core/static/js/core/pdf.js @@ -128,11 +128,14 @@ angular.module('OpenSlidesApp.core.pdf', []) }); }; + //checks if str is valid HTML. Returns valid HTML if not, //return emptystring if empty HTMLValidizer.validize = function(str) { if (str) { str = HTMLValidizer.replaceMalformedUmlauts(str); + // Sometimes, some \n are in the text instead of whitespaces. Replace them. + str = str.replace(/\n/g, ' '); var a = document.createElement('div'); a.innerHTML = str; @@ -143,7 +146,7 @@ angular.module('OpenSlidesApp.core.pdf', []) }); return "

" + str + "

"; } else { - return ""; //needed for blank "reaons" field + return ""; //needed for blank "reasons" field } }; return HTMLValidizer; @@ -823,6 +826,9 @@ angular.module('OpenSlidesApp.core.pdf', []) if (classes.indexOf('os-split-before') === -1) { currentParagraph.margin[1] = 8; } + if (classes.indexOf('insert') > -1) { + currentParagraph.margin[0] = 20; + } } currentParagraph.lineHeight = 1.25; var stackP = create("stack"); diff --git a/openslides/motions/static/js/motions/base.js b/openslides/motions/static/js/motions/base.js index b44d452f4..573a86e89 100644 --- a/openslides/motions/static/js/motions/base.js +++ b/openslides/motions/static/js/motions/base.js @@ -505,6 +505,7 @@ angular.module('OpenSlidesApp.motions', [ case 'create_poll': return ( operator.hasPerms('motions.can_manage') && + this.state && this.state.allow_create_poll ); case 'support':