Skip to content

Commit

Permalink
Fixed editing class and respanning at same time (isssue #97)
Browse files Browse the repository at this point in the history
  • Loading branch information
proycon committed Dec 28, 2016
1 parent b9209fb commit c4d5c4f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions flat/style/flat.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,7 @@ function gather_changes() {
}


if ((!editdata[i].changed) && (JSON.stringify(editdata[i].targets) != JSON.stringify(editdata[i].targets_begin)) && (editdata[i].editform != 'new')) {
if ((JSON.stringify(editdata[i].targets) != JSON.stringify(editdata[i].targets_begin)) && (editdata[i].editform != 'new')) {
//detect changes in span, and set the changed flag
editdata[i].changed = true;
editdata[i].respan = true;
Expand Down Expand Up @@ -1603,7 +1603,7 @@ function build_queries(addtoqueue) {
query += "SUBSTITUTE w WITH text \"" + escape_fql_value(editdata[i].text) + "\"";
}
}
if (editdata[i].respan) { //isspan && editdata[i].id && (action == "EDIT")) {
if ((editdata[i].respan) && (action != "SUBSTITUTE")) { //isspan && editdata[i].id && (action == "EDIT")) {
//we edit a span annotation, edittargets reflects the new span:
if (editdata[i].targets.length > 0) {
query += " RESPAN ";
Expand All @@ -1617,6 +1617,8 @@ function build_queries(addtoqueue) {
query += forids;
}
returntype = "ancestor-focus";
} else if (action == "SUBSTIUTE") {
editdata[i].respan = false;
}


Expand Down

0 comments on commit c4d5c4f

Please sign in to comment.