Merge pull request #2655 from CatoTH/Issue2615-line-selection-improvements

A small tooltip after selecting the first line when creating a change recommendation
This commit is contained in:
Emanuel Schütze 2016-11-28 20:45:07 +01:00 committed by GitHub
commit ddfafd327b
3 changed files with 19 additions and 1 deletions

View File

@ -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 */

View File

@ -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) {

View File

@ -46,3 +46,8 @@
</div>
</li>
</ul>
<div class="tooltip top tt_change_recommendation_create_help" role="tooltip">
<div class="tooltip-arrow"></div>
<div class="tooltip-inner" translate>Now choose the last line to be changed</div>
</div>