Skip to content

Commit

Permalink
Properly populate parent span field also for newly added annotations (#3
Browse files Browse the repository at this point in the history
 e)
  • Loading branch information
proycon committed Dec 2, 2016
1 parent 73266ea commit 63399e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions flat/style/flat.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -991,6 +991,15 @@ function addeditorfield(index) {
var ho_result = renderhigherorderfields(editfields, editoraddablefields[index]); //will always be empty but sets a proper placeholder we can use
s = s + ho_result.output;

var nestablespan = folia_nestablespan(editoraddablefields[index].type);
if (nestablespan.length > 0) {
editoraddablefields[index].layerparent = structure[editedelementid].parent;
while ((structure[editoraddablefields[index].layerparent].type == 'correction') || (structure[editoraddablefields[index].layerparent].type == 'part')) {
editoraddablefields[index].layerparent = structure[editoraddablefields[index].layerparent].parent;
}
s = s + renderparentspanfield(editfields, editoraddablefields[index], nestablespan);
}

s = s + "</td></tr><tr id=\"editrowplaceholder\"></tr>";
$('#editrowplaceholder')[0].outerHTML = s;

Expand Down

0 comments on commit 63399e5

Please sign in to comment.