MDL-42355 assignfeedback_editpdf - do not start a new comment immediately when deselecting the old comment

This commit is contained in:
Davo Smith 2013-10-22 18:46:45 +01:00
parent 6e67d80d50
commit 60b8708076
5 changed files with 52 additions and 4 deletions

View file

@ -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) {

View file

@ -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) {

View file

@ -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.

View file

@ -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) {