*/
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;
'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;
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,
color: COMMENTTEXTCOLOUR
});
- drawingcanvas.append(container);
+ drawingregion.append(container);
container.setStyle('position', 'absolute');
container.setX(position.x);
container.setY(position.y);