MDL-53822 editpdf: Show different cursors for select and move

This commit is contained in:
Damyon Wiese 2016-05-11 14:54:38 +08:00
parent 55907a738a
commit ab4d78ea82
5 changed files with 22 additions and 7 deletions

View File

@ -18,6 +18,12 @@
.assignfeedback_editpdf_widget .moodle-dialogue-bd .drawingregion {
position: inherit;
}
.assignfeedback_editpdf_widget .drawingregion[data-currenttool=drag] .drawingcanvas {
cursor: move;
}
.assignfeedback_editpdf_widget .drawingregion[data-currenttool=select] .drawingcanvas {
cursor: pointer;
}
.assignfeedback_editpdf_widget .drawingregion {
border: 1px solid #ccc;
left: 1em;

View File

@ -3295,7 +3295,7 @@ EDITOR.prototype = {
* @method refresh_button_state
*/
refresh_button_state : function() {
var button, currenttoolnode, imgurl;
var button, currenttoolnode, imgurl, drawingregion;
// Initalise the colour buttons.
button = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
@ -3316,6 +3316,8 @@ EDITOR.prototype = {
currenttoolnode = this.get_dialogue_element(TOOLSELECTOR[this.currentedit.tool]);
currenttoolnode.addClass('assignfeedback_editpdf_selectedbutton');
currenttoolnode.setAttribute('aria-pressed', 'true');
drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
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),
@ -3729,6 +3731,7 @@ EDITOR.prototype = {
currenttoolnode.removeClass('assignfeedback_editpdf_selectedbutton');
currenttoolnode.setAttribute('aria-pressed', 'false');
this.currentedit.tool = tool;
if (tool !== "comment" && tool !== "select" && tool !== "drag" && tool !== "stamp") {
this.lastannotationtool = tool;
}

View File

@ -3295,7 +3295,7 @@ EDITOR.prototype = {
* @method refresh_button_state
*/
refresh_button_state : function() {
var button, currenttoolnode, imgurl;
var button, currenttoolnode, imgurl, drawingregion;
// Initalise the colour buttons.
button = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
@ -3316,6 +3316,8 @@ EDITOR.prototype = {
currenttoolnode = this.get_dialogue_element(TOOLSELECTOR[this.currentedit.tool]);
currenttoolnode.addClass('assignfeedback_editpdf_selectedbutton');
currenttoolnode.setAttribute('aria-pressed', 'true');
drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
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),
@ -3729,6 +3731,7 @@ EDITOR.prototype = {
currenttoolnode.removeClass('assignfeedback_editpdf_selectedbutton');
currenttoolnode.setAttribute('aria-pressed', 'false');
this.currentedit.tool = tool;
if (tool !== "comment" && tool !== "select" && tool !== "drag" && tool !== "stamp") {
this.lastannotationtool = tool;
}

View File

@ -238,7 +238,7 @@ EDITOR.prototype = {
* @method refresh_button_state
*/
refresh_button_state : function() {
var button, currenttoolnode, imgurl;
var button, currenttoolnode, imgurl, drawingregion;
// Initalise the colour buttons.
button = this.get_dialogue_element(SELECTOR.COMMENTCOLOURBUTTON);
@ -259,6 +259,8 @@ EDITOR.prototype = {
currenttoolnode = this.get_dialogue_element(TOOLSELECTOR[this.currentedit.tool]);
currenttoolnode.addClass('assignfeedback_editpdf_selectedbutton');
currenttoolnode.setAttribute('aria-pressed', 'true');
drawingregion = this.get_dialogue_element(SELECTOR.DRAWINGREGION);
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),
@ -672,6 +674,7 @@ EDITOR.prototype = {
currenttoolnode.removeClass('assignfeedback_editpdf_selectedbutton');
currenttoolnode.setAttribute('aria-pressed', 'false');
this.currentedit.tool = tool;
if (tool !== "comment" && tool !== "select" && tool !== "drag" && tool !== "stamp") {
this.lastannotationtool = tool;
}