Skip to content

Commit

Permalink
FIX: Visual cue for fragment selection during coding (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lejeune committed Oct 7, 2022
1 parent 33c4c33 commit 4d00505
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/_attachments/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,16 @@ button.comment {
transition-delay: 2s;
}

.coding-candidate {
background-image: url('coding.svg');
background-repeat: no-repeat;
background-position: right bottom;
background-color: lightgrey;
transition:
background-color 1s,
background-image 5s 10s;
}

.fadeout {
background-color: transparent;
color: black;
Expand Down
9 changes: 9 additions & 0 deletions app/_attachments/memo.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,18 @@ $('#content').on('mouseup', function() {
p = 1 + ([].indexOf.call(posts[0].childNodes, selected))/2;
if (this_type == 'interview') p = [].indexOf.call(posts[0].childNodes, selected.parentNode);
if (p > -1 && Number.isInteger(p)) anchor = p;
if ($("#add").length > 0 && ['interview', 'field'].indexOf(this_type) > -1 && document.getSelection().toString().length > 0) {
$('.post').children().eq(p-1)
.removeClass('highlight fadeout')
.addClass('coding-candidate');
}
}
});

$('#content').on('mousedown', function() {
$('.coding-candidate').removeClass('coding-candidate');
});

$('#create').on('click', function() {
var name = $('#leave-name').val().trim(),
classlist = $(this)[0].classList,
Expand Down

0 comments on commit 4d00505

Please sign in to comment.