Skip to content

Commit

Permalink
FEATURE: Coding fragments of a field memo (#106)
Browse files Browse the repository at this point in the history
  • Loading branch information
christophe-lejeune committed Apr 4, 2022
1 parent b359c29 commit 1d60e5f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions app/templates/memo.html
Original file line number Diff line number Diff line change
Expand Up @@ -473,11 +473,17 @@ <h1 {{#editable}}class="editable"{{/editable}}><img src="{{>relpath}}style/{{typ
});

$('#content').on('mouseup', function() {
if (window.getSelection().anchorNode !== null)
var posts = document.getElementsByClassName('post'),
selected = window.getSelection().anchorNode.parentNode.parentNode,
p = [].indexOf.call(posts[0].childNodes, selected);
if (p > -1) anchor = p;
if (window.getSelection().anchorNode !== null) {
var posts = document.getElementsByClassName('post'),
selected = window.getSelection().anchorNode.parentNode,
p = [].indexOf.call(posts[0].childNodes, selected);
if (this_type == 'interview') {
p = [].indexOf.call(posts[0].childNodes, selected.parentNode);
} else {
p = (p/2) + 1;
}
if (p > -1) anchor = p;
}
});

$('#create').on('click', function() {
Expand Down

0 comments on commit 1d60e5f

Please sign in to comment.