Merge branch 'MDL-55240-master' of git://github.com/junpataleta/moodle

This commit is contained in:
Dan Poltawski 2016-07-18 10:51:06 +01:00
commit 5e60c1d436
5 changed files with 45 additions and 18 deletions

View File

@ -1564,7 +1564,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
*/
draw : function() {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
node,
position;
@ -1580,10 +1580,19 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
'zIndex': 50
});
drawingcanvas.append(node);
drawingregion.append(node);
node.setX(position.x);
node.setY(position.y);
drawable.store_position(node, position.x, position.y);
// Bind events only when editing.
if (!this.editor.get('readonly')) {
// Pass through 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);
this.drawable = drawable;
@ -2515,7 +2524,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
this.draw = function(focus) {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
node,
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
container,
menu,
position,
@ -2545,7 +2554,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
color: COMMENTTEXTCOLOUR
});
drawingcanvas.append(container);
drawingregion.append(container);
container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);

View File

@ -1564,7 +1564,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
*/
draw : function() {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
node,
position;
@ -1580,10 +1580,19 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
'zIndex': 50
});
drawingcanvas.append(node);
drawingregion.append(node);
node.setX(position.x);
node.setY(position.y);
drawable.store_position(node, position.x, position.y);
// Bind events only when editing.
if (!this.editor.get('readonly')) {
// Pass through 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);
this.drawable = drawable;
@ -2515,7 +2524,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
this.draw = function(focus) {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
node,
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
container,
menu,
position,
@ -2545,7 +2554,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
color: COMMENTTEXTCOLOUR
});
drawingcanvas.append(container);
drawingregion.append(container);
container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);

View File

@ -43,7 +43,7 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
*/
draw : function() {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
node,
position;
@ -59,10 +59,19 @@ Y.extend(ANNOTATIONSTAMP, M.assignfeedback_editpdf.annotation, {
'zIndex': 50
});
drawingcanvas.append(node);
drawingregion.append(node);
node.setX(position.x);
node.setY(position.y);
drawable.store_position(node, position.x, position.y);
// Bind events only when editing.
if (!this.editor.get('readonly')) {
// Pass through 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);
this.drawable = drawable;

View File

@ -160,7 +160,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
this.draw = function(focus) {
var drawable = new M.assignfeedback_editpdf.drawable(this.editor),
node,
drawingcanvas = this.editor.get_dialogue_element(SELECTOR.DRAWINGCANVAS),
drawingregion = this.editor.get_dialogue_element(SELECTOR.DRAWINGREGION),
container,
menu,
position,
@ -190,7 +190,7 @@ var COMMENT = function(editor, gradeid, pageno, x, y, width, colour, rawtext) {
color: COMMENTTEXTCOLOUR
});
drawingcanvas.append(container);
drawingregion.append(container);
container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);