Commit 9d86cbaf authored by bbaer's avatar bbaer
Browse files

fix for #7783

parent a292f669
......@@ -63,22 +63,15 @@ var QfqNS = QfqNS || {};
this.currentUser = $container.data("uid");
var that = this;
if (this.readOnly) {
var jsonAnnotations = this.$parent.data("annotations");
this.annotations = jsonAnnotations.annotations;
this.users = jsonAnnotations.users;
} else {
if (this.$target.val()) {
var jImport = $.parseJSON(this.$target.val());
if (jImport.annotations) {
this.annotations = jImport.annotations;
console.log("[CodeCorrection] Imported Annotations: " + this.annotations.length);
}
if (jImport.users) {
this.users = jImport.users;
console.log("[CodeCorrection] Imported Users: " + this.users.length);
}
if (this.$parent.data("annotations")) {
var jsonAnnotations = this.$parent.data("annotations");
this.annotations = jsonAnnotations.annotations;
this.users = jsonAnnotations.users;
} else {
this._importFromTarget();
}
} else {
this._importFromTarget();
}
if (this.data.url) {
......@@ -94,6 +87,20 @@ var QfqNS = QfqNS || {};
}
};
n.CodeCorrection.prototype._importFromTarget = function() {
if (this.$target.val()) {
var jImport = $.parseJSON(this.$target.val());
if (jImport.annotations) {
this.annotations = jImport.annotations;
console.log("[CodeCorrection] Imported Annotations: " + this.annotations.length);
}
if (jImport.users) {
this.users = jImport.users;
console.log("[CodeCorrection] Imported Users: " + this.users.length);
}
}
};
n.CodeCorrection.prototype._prepareBuild = function() {
var that = this;
this.syntaxHighlight = new n.SyntaxHighlighter();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment