Merge branch 'MDL-60123-33' of https://github.com/snake/moodle into MOODLE_33_STABLE

This commit is contained in:
David Monllao
2017-10-20 02:22:26 +02:00
4 changed files with 73 additions and 25 deletions
@@ -3372,6 +3372,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
@@ -4144,8 +4152,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) {
@@ -4177,13 +4184,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.
@@ -4191,6 +4198,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) {
File diff suppressed because one or more lines are too long
@@ -3372,6 +3372,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
@@ -4144,8 +4152,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) {
@@ -4177,13 +4184,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.
@@ -4191,6 +4198,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
View File
@@ -159,6 +159,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
@@ -931,8 +939,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) {
@@ -964,13 +971,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.
@@ -978,6 +985,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) {