Permalink
Browse files

MDL-42355 assignfeedback_editpdf - do not start a new comment immedia…

…tely when deselecting the old comment
  • Loading branch information...
davosmith committed Oct 22, 2013
1 parent 6e67d80 commit 60b87080765dc65b95228ff4ca741a3a194200b5
@@ -2368,6 +2368,7 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
Y.later(400, this, this.delete_comment_later);
}
this.editor.save_current_page();
+ this.editor.editingcomment = false;
}, this);
// For delegated event handler.
@@ -2995,6 +2996,16 @@ EDITOR.prototype = {
*/
stamps : [],
+ /**
+ * Prevent new comments from appearing
+ * immediately after clicking off a current
+ * comment
+ * @property editingcomment
+ * @type Boolean
+ * @public
+ */
+ editingcomment : false,
+
/**
* Called during the initialisation process of the object.
* @method initializer
@@ -3440,6 +3451,10 @@ EDITOR.prototype = {
return;
}
+ if (this.editingcomment) {
+ return;
+ }
+
this.currentedit.starttime = new Date().getTime();
this.currentedit.start = point;
this.currentedit.end = {x : point.x, y : point.y};
@@ -3541,6 +3556,7 @@ EDITOR.prototype = {
comment.init_from_edit(this.currentedit);
this.pages[this.currentpage].comments.push(comment);
this.drawables.push(comment.draw(true));
+ this.editingcomment = true;
} else {
annotation = this.create_annotation(this.currentedit.tool, {});
if (annotation) {

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -2368,6 +2368,7 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
Y.later(400, this, this.delete_comment_later);
}
this.editor.save_current_page();
+ this.editor.editingcomment = false;
}, this);
// For delegated event handler.
@@ -2995,6 +2996,16 @@ EDITOR.prototype = {
*/
stamps : [],
+ /**
+ * Prevent new comments from appearing
+ * immediately after clicking off a current
+ * comment
+ * @property editingcomment
+ * @type Boolean
+ * @public
+ */
+ editingcomment : false,
+
/**
* Called during the initialisation process of the object.
* @method initializer
@@ -3440,6 +3451,10 @@ EDITOR.prototype = {
return;
}
+ if (this.editingcomment) {
+ return;
+ }
+
this.currentedit.starttime = new Date().getTime();
this.currentedit.start = point;
this.currentedit.end = {x : point.x, y : point.y};
@@ -3541,6 +3556,7 @@ EDITOR.prototype = {
comment.init_from_edit(this.currentedit);
this.pages[this.currentpage].comments.push(comment);
this.drawables.push(comment.draw(true));
+ this.editingcomment = true;
} else {
annotation = this.create_annotation(this.currentedit.tool, {});
if (annotation) {
@@ -243,6 +243,7 @@ COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
Y.later(400, this, this.delete_comment_later);
}
this.editor.save_current_page();
+ this.editor.editingcomment = false;
}, this);
// For delegated event handler.
@@ -171,6 +171,16 @@ EDITOR.prototype = {
*/
stamps : [],
+ /**
+ * Prevent new comments from appearing
+ * immediately after clicking off a current
+ * comment
+ * @property editingcomment
+ * @type Boolean
+ * @public
+ */
+ editingcomment : false,
+
/**
* Called during the initialisation process of the object.
* @method initializer
@@ -616,6 +626,10 @@ EDITOR.prototype = {
return;
}
+ if (this.editingcomment) {
+ return;
+ }
+
this.currentedit.starttime = new Date().getTime();
this.currentedit.start = point;
this.currentedit.end = {x : point.x, y : point.y};
@@ -717,6 +731,7 @@ EDITOR.prototype = {
comment.init_from_edit(this.currentedit);
this.pages[this.currentpage].comments.push(comment);
this.drawables.push(comment.draw(true));
+ this.editingcomment = true;
} else {
annotation = this.create_annotation(this.currentedit.tool, {});
if (annotation) {

0 comments on commit 60b8708

Please sign in to comment.