From f380f6385177cc3a2a9f29d974c7460208e13470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20Ho=CC=88=C3=9Fl?= Date: Sat, 19 Nov 2016 16:51:19 +0100 Subject: [PATCH] A proposition so mitigate #2615 --- openslides/core/static/css/app.css | 10 ++++++++++ .../motions/static/js/motions/motion-services.js | 5 ++++- .../templates/motions/motion-detail/view-original.html | 5 +++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/openslides/core/static/css/app.css b/openslides/core/static/css/app.css index a8e30f1b4..37e8a9fb7 100644 --- a/openslides/core/static/css/app.css +++ b/openslides/core/static/css/app.css @@ -487,6 +487,16 @@ img { background-color: #337ab7; } +.tt_change_recommendation_create_help { + display: none; + max-width: 150px; + left: -45px; + margin-top: -8px; +} +.tt_change_recommendation_create_help.opened { + display: inherit; + opacity: 0.8; +} /** Styles for annotating the original motion text with change recommendations */ diff --git a/openslides/motions/static/js/motions/motion-services.js b/openslides/motions/static/js/motions/motion-services.js index 95990e4cb..4ce02ebf8 100644 --- a/openslides/motions/static/js/motions/motion-services.js +++ b/openslides/motions/static/js/motions/motion-services.js @@ -204,6 +204,7 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions', return; } + $(".tt_change_recommendation_create_help").removeClass("opened"); var $lineNumbers = $(".motion-text-original .os-line-number"); if ($lineNumbers.filter(".selectable").length === 0) { obj.mode = MODE_SELECTING_FROM; @@ -238,7 +239,6 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions', foundCollission = false; $(".motion-text-original .os-line-number").each(function () { - var $this = $(this); if ($this.data("line-number") >= line && !foundCollission) { if (alreadyAffectedLines.indexOf($this.data("line-number")) == -1) { @@ -251,6 +251,9 @@ angular.module('OpenSlidesApp.motions.motionservices', ['OpenSlidesApp.motions', $(this).removeClass("selectable"); } }); + + var tt_pos = $(".motion-text-original .line-number-" + line).position().top - 45; + $(".tt_change_recommendation_create_help").css("top", tt_pos).addClass("opened"); }; obj.setToLine = function (line) { diff --git a/openslides/motions/static/templates/motions/motion-detail/view-original.html b/openslides/motions/static/templates/motions/motion-detail/view-original.html index a8e207d73..7c33cba43 100644 --- a/openslides/motions/static/templates/motions/motion-detail/view-original.html +++ b/openslides/motions/static/templates/motions/motion-detail/view-original.html @@ -46,3 +46,8 @@ + +