From 9e46924c77c5c47e8ab73bdc65149648e07a1e75 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 3 Nov 2017 11:42:10 +0100 Subject: [PATCH] Template changes and IE fix - Fix IE11 that projector shows JS error if 'startsWith' is used. Projector was updated very slowly. - Hide the valid/invalid/casted ballot rows on projector if empty. - Use 80% width for motion reason in PDF. --- .../templates/assignments/slide_assignment.html | 14 ++++++++------ openslides/core/static/js/core/projector.js | 3 ++- openslides/motions/static/js/motions/pdf.js | 9 ++++++++- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/openslides/assignments/static/templates/assignments/slide_assignment.html b/openslides/assignments/static/templates/assignments/slide_assignment.html index 082afbe32..6f9244eab 100644 --- a/openslides/assignments/static/templates/assignments/slide_assignment.html +++ b/openslides/assignments/static/templates/assignments/slide_assignment.html @@ -77,20 +77,22 @@ - + Valid ballots - + {{ vote.value }} {{ vote.percentStr }} - + + Invalid ballots - + {{ vote.value }} {{ vote.percentStr }} - + + Casted ballots - + {{ vote.value }} {{ vote.percentStr }} diff --git a/openslides/core/static/js/core/projector.js b/openslides/core/static/js/core/projector.js index 9530f6692..f3e6dd2cd 100644 --- a/openslides/core/static/js/core/projector.js +++ b/openslides/core/static/js/core/projector.js @@ -217,7 +217,8 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core']) if (matchingElement) { // copy all changed properties. _.forEach(newElement, function (value, key) { - if (newElement.hasOwnProperty(key) && !key.startsWith('$')) { + // key has own property and does not start with a '$'. + if (newElement.hasOwnProperty(key) && key.indexOf('$') != 0) { if (typeof matchingElement[key] === 'undefined' || matchingElement[key] !== value) { matchingElement[key] = value; } diff --git a/openslides/motions/static/js/motions/pdf.js b/openslides/motions/static/js/motions/pdf.js index 7f8fd39cb..bdef6a492 100644 --- a/openslides/motions/static/js/motions/pdf.js +++ b/openslides/motions/static/js/motions/pdf.js @@ -312,7 +312,14 @@ angular.module('OpenSlidesApp.motions.pdf', ['OpenSlidesApp.core.pdf']) style: 'heading3', marginTop: 25, }); - reason.push(converter.convertHTML(motion.getReason(motionVersion), 'none')); + reason.push({ + columns: [ + { + width: '80%', + stack: converter.convertHTML(motion.getReason(motionVersion), 'none'), + }, + ] + }); } return reason; }