MDL-68223 assign: Fix selection of comment text.

This commit is contained in:
Mikhail Golenkov
2020-03-30 14:57:36 +11:00
parent 49914a57d4
commit 4a363544eb
4 changed files with 24 additions and 6 deletions
@@ -4381,16 +4381,22 @@ EDITOR.prototype = {
* @method edit_move
*/
edit_move: function(e) {
e.preventDefault();
var bounds = this.get_canvas_bounds(),
canvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION),
clientpoint = new M.assignfeedback_editpdf.point(e.clientX + canvas.get('docScrollX'),
e.clientY + canvas.get('docScrollY')),
point = this.get_canvas_coordinates(clientpoint),
activeelement = document.activeElement,
diffX,
diffY;
if (activeelement.type === 'textarea') {
return;
}
e.preventDefault();
// Ignore events out of the canvas area.
if (point.x < 0 || point.x > bounds.width || point.y < 0 || point.y > bounds.height) {
return;
File diff suppressed because one or more lines are too long
@@ -4381,16 +4381,22 @@ EDITOR.prototype = {
* @method edit_move
*/
edit_move: function(e) {
e.preventDefault();
var bounds = this.get_canvas_bounds(),
canvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION),
clientpoint = new M.assignfeedback_editpdf.point(e.clientX + canvas.get('docScrollX'),
e.clientY + canvas.get('docScrollY')),
point = this.get_canvas_coordinates(clientpoint),
activeelement = document.activeElement,
diffX,
diffY;
if (activeelement.type === 'textarea') {
return;
}
e.preventDefault();
// Ignore events out of the canvas area.
if (point.x < 0 || point.x > bounds.width || point.y < 0 || point.y > bounds.height) {
return;
+7 -1
View File
@@ -1084,16 +1084,22 @@ EDITOR.prototype = {
* @method edit_move
*/
edit_move: function(e) {
e.preventDefault();
var bounds = this.get_canvas_bounds(),
canvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION),
clientpoint = new M.assignfeedback_editpdf.point(e.clientX + canvas.get('docScrollX'),
e.clientY + canvas.get('docScrollY')),
point = this.get_canvas_coordinates(clientpoint),
activeelement = document.activeElement,
diffX,
diffY;
if (activeelement.type === 'textarea') {
return;
}
e.preventDefault();
// Ignore events out of the canvas area.
if (point.x < 0 || point.x > bounds.width || point.y < 0 || point.y > bounds.height) {
return;