Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'MDL-42366-master' of https://github.com/lucisgit/moodle
  • Loading branch information
David Monllao committed Jun 4, 2018
2 parents 5b4ca9e + 166ac97 commit b321d23
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 32 deletions.
9 changes: 0 additions & 9 deletions mod/assign/feedback/editpdf/styles.css
Expand Up @@ -10,7 +10,6 @@
position: relative;
min-width: 817px;
min-height: 400px;
cursor: crosshair;
background-repeat: no-repeat;
background-color: #ccc;
margin-left: auto;
Expand All @@ -22,14 +21,6 @@
position: inherit;
}

.assignfeedback_editpdf_widget .drawingregion[data-currenttool=drag] .drawingcanvas {
cursor: move;
}

.assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .drawingcanvas {
cursor: default;
}

.assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .commentdrawable textarea,
.assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .commentdrawable svg {
cursor: move;
Expand Down
Expand Up @@ -1478,13 +1478,13 @@ Y.extend(ANNOTATIONHIGHLIGHT, M.assignfeedback_editpdf.annotation, {
shape = this.editor.graphic.addShape({
type: Y.Rect,
width: bounds.width,
height: 16,
height: 20,
stroke: false,
fill: {
color: highlightcolour
},
x: bounds.x,
y: edit.start.y
y: edit.start.y - 10
});

drawable.shapes.push(shape);
Expand All @@ -1507,9 +1507,9 @@ Y.extend(ANNOTATIONHIGHLIGHT, M.assignfeedback_editpdf.annotation, {
this.gradeid = this.editor.get('gradeid');
this.pageno = this.editor.currentpage;
this.x = bounds.x;
this.y = edit.start.y;
this.y = edit.start.y - 10;
this.endx = bounds.x + bounds.width;
this.endy = edit.start.y + 16;
this.endy = edit.start.y + 10;
this.colour = edit.annotationcolour;
this.page = '';

Expand Down Expand Up @@ -3539,7 +3539,7 @@ EDITOR.prototype = {
* @method refresh_button_state
*/
refresh_button_state: function() {
var button, currenttoolnode, imgurl, drawingregion;
var button, currenttoolnode, imgurl, drawingregion, stampimgurl, drawingcanvas;

// Initalise the colour buttons.
button = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
Expand All @@ -3564,9 +3564,28 @@ EDITOR.prototype = {
drawingregion.setAttribute('data-currenttool', this.currentedit.tool);

button = this.get_dialogue_element(SELECTOR.STAMPSBUTTON);
button.one('img').setAttrs({'src': this.get_stamp_image_url(this.currentedit.stamp),
stampimgurl = this.get_stamp_image_url(this.currentedit.stamp);
button.one('img').setAttrs({'src': stampimgurl,
'height': '16',
'width': '16'});

drawingcanvas = this.get_dialogue_element(SELECTOR.DRAWINGCANVAS);
switch (this.currentedit.tool) {
case 'drag':
drawingcanvas.setStyle('cursor', 'move');
break;
case 'highlight':
drawingcanvas.setStyle('cursor', 'text');
break;
case 'select':
drawingcanvas.setStyle('cursor', 'default');
break;
case 'stamp':
drawingcanvas.setStyle('cursor', 'url(' + stampimgurl + '), crosshair');
break;
default:
drawingcanvas.setStyle('cursor', 'crosshair');
}
},

/**
Expand Down

0 comments on commit b321d23

Please sign in to comment.