mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-54772 mod_assign: Fixes for PDF editor
* Render the annotations and comments within the drawing canvas, not in the drawing region. * Remove edit-related event bindings for stamp annotations.
This commit is contained in:
parent
a0a63678a9
commit
cdbdb2f9b7
5 changed files with 18 additions and 36 deletions
|
@ -1555,7 +1555,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
|
||||||
*/
|
*/
|
||||||
draw : function() {
|
draw : function() {
|
||||||
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
||||||
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
|
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
|
||||||
node,
|
node,
|
||||||
position;
|
position;
|
||||||
|
|
||||||
|
@ -1571,16 +1571,10 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
|
||||||
'zIndex': 50
|
'zIndex': 50
|
||||||
});
|
});
|
||||||
|
|
||||||
drawingregion.append(node);
|
drawingcanvas.append(node);
|
||||||
node.setX(position.x);
|
node.setX(position.x);
|
||||||
node.setY(position.y);
|
node.setY(position.y);
|
||||||
drawable.store_position(node, position.x, position.y);
|
drawable.store_position(node, position.x, position.y);
|
||||||
|
|
||||||
// Pass throught the event handlers on the div.
|
|
||||||
node.on('gesturemovestart', this.editor.edit_start, null, this.editor);
|
|
||||||
node.on('gesturemove', this.editor.edit_move, null, this.editor);
|
|
||||||
node.on('gesturemoveend', this.editor.edit_end, null, this.editor);
|
|
||||||
|
|
||||||
drawable.nodes.push(node);
|
drawable.nodes.push(node);
|
||||||
|
|
||||||
this.drawable = drawable;
|
this.drawable = drawable;
|
||||||
|
@ -2509,7 +2503,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
|
||||||
this.draw = function(focus) {
|
this.draw = function(focus) {
|
||||||
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
||||||
node,
|
node,
|
||||||
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
|
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
|
||||||
container,
|
container,
|
||||||
menu,
|
menu,
|
||||||
position,
|
position,
|
||||||
|
@ -2539,7 +2533,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
|
||||||
color: COMMENTTEXTCOLOUR
|
color: COMMENTTEXTCOLOUR
|
||||||
});
|
});
|
||||||
|
|
||||||
drawingregion.append(container);
|
drawingcanvas.append(container);
|
||||||
container.setStyle('position', 'absolute');
|
container.setStyle('position', 'absolute');
|
||||||
container.setX(position.x);
|
container.setX(position.x);
|
||||||
container.setY(position.y);
|
container.setY(position.y);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1555,7 +1555,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
|
||||||
*/
|
*/
|
||||||
draw : function() {
|
draw : function() {
|
||||||
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
||||||
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
|
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
|
||||||
node,
|
node,
|
||||||
position;
|
position;
|
||||||
|
|
||||||
|
@ -1571,16 +1571,10 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
|
||||||
'zIndex': 50
|
'zIndex': 50
|
||||||
});
|
});
|
||||||
|
|
||||||
drawingregion.append(node);
|
drawingcanvas.append(node);
|
||||||
node.setX(position.x);
|
node.setX(position.x);
|
||||||
node.setY(position.y);
|
node.setY(position.y);
|
||||||
drawable.store_position(node, position.x, position.y);
|
drawable.store_position(node, position.x, position.y);
|
||||||
|
|
||||||
// Pass throught the event handlers on the div.
|
|
||||||
node.on('gesturemovestart', this.editor.edit_start, null, this.editor);
|
|
||||||
node.on('gesturemove', this.editor.edit_move, null, this.editor);
|
|
||||||
node.on('gesturemoveend', this.editor.edit_end, null, this.editor);
|
|
||||||
|
|
||||||
drawable.nodes.push(node);
|
drawable.nodes.push(node);
|
||||||
|
|
||||||
this.drawable = drawable;
|
this.drawable = drawable;
|
||||||
|
@ -2509,7 +2503,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
|
||||||
this.draw = function(focus) {
|
this.draw = function(focus) {
|
||||||
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
||||||
node,
|
node,
|
||||||
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
|
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
|
||||||
container,
|
container,
|
||||||
menu,
|
menu,
|
||||||
position,
|
position,
|
||||||
|
@ -2539,7 +2533,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
|
||||||
color: COMMENTTEXTCOLOUR
|
color: COMMENTTEXTCOLOUR
|
||||||
});
|
});
|
||||||
|
|
||||||
drawingregion.append(container);
|
drawingcanvas.append(container);
|
||||||
container.setStyle('position', 'absolute');
|
container.setStyle('position', 'absolute');
|
||||||
container.setX(position.x);
|
container.setX(position.x);
|
||||||
container.setY(position.y);
|
container.setY(position.y);
|
||||||
|
|
|
@ -42,7 +42,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
|
||||||
*/
|
*/
|
||||||
draw : function() {
|
draw : function() {
|
||||||
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
||||||
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
|
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
|
||||||
node,
|
node,
|
||||||
position;
|
position;
|
||||||
|
|
||||||
|
@ -58,16 +58,10 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
|
||||||
'zIndex': 50
|
'zIndex': 50
|
||||||
});
|
});
|
||||||
|
|
||||||
drawingregion.append(node);
|
drawingcanvas.append(node);
|
||||||
node.setX(position.x);
|
node.setX(position.x);
|
||||||
node.setY(position.y);
|
node.setY(position.y);
|
||||||
drawable.store_position(node, position.x, position.y);
|
drawable.store_position(node, position.x, position.y);
|
||||||
|
|
||||||
// Pass throught the event handlers on the div.
|
|
||||||
node.on('gesturemovestart', this.editor.edit_start, null, this.editor);
|
|
||||||
node.on('gesturemove', this.editor.edit_move, null, this.editor);
|
|
||||||
node.on('gesturemoveend', this.editor.edit_end, null, this.editor);
|
|
||||||
|
|
||||||
drawable.nodes.push(node);
|
drawable.nodes.push(node);
|
||||||
|
|
||||||
this.drawable = drawable;
|
this.drawable = drawable;
|
||||||
|
|
|
@ -159,7 +159,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
|
||||||
this.draw = function(focus) {
|
this.draw = function(focus) {
|
||||||
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
|
||||||
node,
|
node,
|
||||||
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
|
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
|
||||||
container,
|
container,
|
||||||
menu,
|
menu,
|
||||||
position,
|
position,
|
||||||
|
@ -189,7 +189,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
|
||||||
color: COMMENTTEXTCOLOUR
|
color: COMMENTTEXTCOLOUR
|
||||||
});
|
});
|
||||||
|
|
||||||
drawingregion.append(container);
|
drawingcanvas.append(container);
|
||||||
container.setStyle('position', 'absolute');
|
container.setStyle('position', 'absolute');
|
||||||
container.setX(position.x);
|
container.setX(position.x);
|
||||||
container.setY(position.y);
|
container.setY(position.y);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue