Merge branch 'MDL-60123-32' of https://github.com/snake/moodle into MOODLE_32_STABLE
This commit is contained in:
+23
-7
@@ -3241,6 +3241,14 @@ EDITOR.prototype = {
|
||||
*/
|
||||
currentannotation: null,
|
||||
|
||||
/**
|
||||
* Track the previous annotation so we can remove selection highlights.
|
||||
* @property lastannotation
|
||||
* @type M.assignfeedback_editpdf.annotation
|
||||
* @protected
|
||||
*/
|
||||
lastannotation: null,
|
||||
|
||||
/**
|
||||
* Last selected annotation tool
|
||||
* @property lastannotationtool
|
||||
@@ -3871,8 +3879,7 @@ EDITOR.prototype = {
|
||||
scrollleft = canvas.get('docScrollX'),
|
||||
point = {x: e.clientX - offset[0] + scrollleft,
|
||||
y: e.clientY - offset[1] + scrolltop},
|
||||
selected = false,
|
||||
lastannotation;
|
||||
selected = false;
|
||||
|
||||
// Ignore right mouse click.
|
||||
if (e.button === 3) {
|
||||
@@ -3904,13 +3911,13 @@ EDITOR.prototype = {
|
||||
});
|
||||
|
||||
if (selected) {
|
||||
lastannotation = this.currentannotation;
|
||||
this.lastannotation = this.currentannotation;
|
||||
this.currentannotation = selected;
|
||||
if (lastannotation && lastannotation !== selected) {
|
||||
if (this.lastannotation && this.lastannotation !== selected) {
|
||||
// Redraw the last selected annotation to remove the highlight.
|
||||
if (lastannotation.drawable) {
|
||||
lastannotation.drawable.erase();
|
||||
this.drawables.push(lastannotation.draw());
|
||||
if (this.lastannotation.drawable) {
|
||||
this.lastannotation.drawable.erase();
|
||||
this.drawables.push(this.lastannotation.draw());
|
||||
}
|
||||
}
|
||||
// Redraw the newly selected annotation to show the highlight.
|
||||
@@ -3918,6 +3925,15 @@ EDITOR.prototype = {
|
||||
this.currentannotation.drawable.erase();
|
||||
}
|
||||
this.drawables.push(this.currentannotation.draw());
|
||||
} else {
|
||||
this.lastannotation = this.currentannotation;
|
||||
this.currentannotation = null;
|
||||
|
||||
// Redraw the last selected annotation to remove the highlight.
|
||||
if (this.lastannotation && this.lastannotation.drawable) {
|
||||
this.lastannotation.drawable.erase();
|
||||
this.drawables.push(this.lastannotation.draw());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.currentannotation) {
|
||||
|
||||
+4
-4
File diff suppressed because one or more lines are too long
+23
-7
@@ -3241,6 +3241,14 @@ EDITOR.prototype = {
|
||||
*/
|
||||
currentannotation: null,
|
||||
|
||||
/**
|
||||
* Track the previous annotation so we can remove selection highlights.
|
||||
* @property lastannotation
|
||||
* @type M.assignfeedback_editpdf.annotation
|
||||
* @protected
|
||||
*/
|
||||
lastannotation: null,
|
||||
|
||||
/**
|
||||
* Last selected annotation tool
|
||||
* @property lastannotationtool
|
||||
@@ -3871,8 +3879,7 @@ EDITOR.prototype = {
|
||||
scrollleft = canvas.get('docScrollX'),
|
||||
point = {x: e.clientX - offset[0] + scrollleft,
|
||||
y: e.clientY - offset[1] + scrolltop},
|
||||
selected = false,
|
||||
lastannotation;
|
||||
selected = false;
|
||||
|
||||
// Ignore right mouse click.
|
||||
if (e.button === 3) {
|
||||
@@ -3904,13 +3911,13 @@ EDITOR.prototype = {
|
||||
});
|
||||
|
||||
if (selected) {
|
||||
lastannotation = this.currentannotation;
|
||||
this.lastannotation = this.currentannotation;
|
||||
this.currentannotation = selected;
|
||||
if (lastannotation && lastannotation !== selected) {
|
||||
if (this.lastannotation && this.lastannotation !== selected) {
|
||||
// Redraw the last selected annotation to remove the highlight.
|
||||
if (lastannotation.drawable) {
|
||||
lastannotation.drawable.erase();
|
||||
this.drawables.push(lastannotation.draw());
|
||||
if (this.lastannotation.drawable) {
|
||||
this.lastannotation.drawable.erase();
|
||||
this.drawables.push(this.lastannotation.draw());
|
||||
}
|
||||
}
|
||||
// Redraw the newly selected annotation to show the highlight.
|
||||
@@ -3918,6 +3925,15 @@ EDITOR.prototype = {
|
||||
this.currentannotation.drawable.erase();
|
||||
}
|
||||
this.drawables.push(this.currentannotation.draw());
|
||||
} else {
|
||||
this.lastannotation = this.currentannotation;
|
||||
this.currentannotation = null;
|
||||
|
||||
// Redraw the last selected annotation to remove the highlight.
|
||||
if (this.lastannotation && this.lastannotation.drawable) {
|
||||
this.lastannotation.drawable.erase();
|
||||
this.drawables.push(this.lastannotation.draw());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.currentannotation) {
|
||||
|
||||
+23
-7
@@ -150,6 +150,14 @@ EDITOR.prototype = {
|
||||
*/
|
||||
currentannotation: null,
|
||||
|
||||
/**
|
||||
* Track the previous annotation so we can remove selection highlights.
|
||||
* @property lastannotation
|
||||
* @type M.assignfeedback_editpdf.annotation
|
||||
* @protected
|
||||
*/
|
||||
lastannotation: null,
|
||||
|
||||
/**
|
||||
* Last selected annotation tool
|
||||
* @property lastannotationtool
|
||||
@@ -780,8 +788,7 @@ EDITOR.prototype = {
|
||||
scrollleft = canvas.get('docScrollX'),
|
||||
point = {x: e.clientX - offset[0] + scrollleft,
|
||||
y: e.clientY - offset[1] + scrolltop},
|
||||
selected = false,
|
||||
lastannotation;
|
||||
selected = false;
|
||||
|
||||
// Ignore right mouse click.
|
||||
if (e.button === 3) {
|
||||
@@ -813,13 +820,13 @@ EDITOR.prototype = {
|
||||
});
|
||||
|
||||
if (selected) {
|
||||
lastannotation = this.currentannotation;
|
||||
this.lastannotation = this.currentannotation;
|
||||
this.currentannotation = selected;
|
||||
if (lastannotation && lastannotation !== selected) {
|
||||
if (this.lastannotation && this.lastannotation !== selected) {
|
||||
// Redraw the last selected annotation to remove the highlight.
|
||||
if (lastannotation.drawable) {
|
||||
lastannotation.drawable.erase();
|
||||
this.drawables.push(lastannotation.draw());
|
||||
if (this.lastannotation.drawable) {
|
||||
this.lastannotation.drawable.erase();
|
||||
this.drawables.push(this.lastannotation.draw());
|
||||
}
|
||||
}
|
||||
// Redraw the newly selected annotation to show the highlight.
|
||||
@@ -827,6 +834,15 @@ EDITOR.prototype = {
|
||||
this.currentannotation.drawable.erase();
|
||||
}
|
||||
this.drawables.push(this.currentannotation.draw());
|
||||
} else {
|
||||
this.lastannotation = this.currentannotation;
|
||||
this.currentannotation = null;
|
||||
|
||||
// Redraw the last selected annotation to remove the highlight.
|
||||
if (this.lastannotation && this.lastannotation.drawable) {
|
||||
this.lastannotation.drawable.erase();
|
||||
this.drawables.push(this.lastannotation.draw());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.currentannotation) {
|
||||
|
||||
Reference in New Issue
Block a user