Skip to content

Commit

Permalink
adjust cursor when switching between pointer and drawing modes
Browse files Browse the repository at this point in the history
  • Loading branch information
rsinghal committed Aug 19, 2016
1 parent f86d46a commit a3ee97f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
3 changes: 1 addition & 2 deletions css/mirador.css
Expand Up @@ -1062,7 +1062,6 @@ li.highlight {
pointer-events: none;
}*/
.hud-control {
cursor: pointer;
color:white;
text-shadow: 0 0 5px black;
/*transition: all 0.3s ease;*/
Expand All @@ -1071,7 +1070,6 @@ li.highlight {
z-index:2;
}
.hud-container {
cursor: pointer;
color:white;
text-shadow: 0 0 5px black;
transition: all 0.3s ease;
Expand All @@ -1080,6 +1078,7 @@ li.highlight {
}
.hud-control:hover {
/*transition: all 0.3s ease;*/
cursor: pointer;
opacity: 1;
}
.hud-control.selected {
Expand Down
10 changes: 5 additions & 5 deletions js/src/annotations/osd-svg-overlay.js
Expand Up @@ -465,7 +465,7 @@
onMouseUp: function(event) {
if (!this.overlay.disabled) {
event.stopPropagation();
jQuery(this.overlay.viewer.canvas).css('cursor','default');
//jQuery(this.overlay.viewer.canvas).css('cursor','default');
// if (this.overlay.mode === 'deform' || this.overlay.mode === 'edit') {
// this.overlay.segment = null;
// this.overlay.()) = null;
Expand Down Expand Up @@ -510,10 +510,10 @@
this.overlay.cursorLocation = event.point;
if (!this.overlay.disabled) {
// We are in drawing mode
if (this.overlay.paperScope.project.hitTest(event.point, this.overlay.hitOptions)) {
} else {
jQuery(this.overlay.viewer.canvas).css('cursor','default');
}
// if (this.overlay.paperScope.project.hitTest(event.point, this.overlay.hitOptions)) {
// } else {
// //jQuery(this.overlay.viewer.canvas).css('cursor','default');
// }
event.stopPropagation();
if (this.overlay.currentTool) {
this.overlay.currentTool.onMouseMove(event, this.overlay);
Expand Down
4 changes: 4 additions & 0 deletions js/src/widgets/hud.js
Expand Up @@ -80,6 +80,7 @@
}
_this.eventEmitter.publish('modeChange.' + _this.windowId, 'displayAnnotations');
_this.eventEmitter.publish('HUD_ADD_CLASS.'+_this.windowId, ['.mirador-osd-pointer-mode', 'selected']);
_this.eventEmitter.publish('DEFAULT_CURSOR.' + _this.windowId);
_this.eventEmitter.publish(('windowUpdated'), {
id: _this.windowId,
annotationState: to
Expand All @@ -104,6 +105,7 @@
_this.eventEmitter.publish('HUD_ADD_CLASS.'+_this.windowId, ['.mirador-osd-pointer-mode', 'selected']);
_this.eventEmitter.publish('CANCEL_ACTIVE_ANNOTATIONS.'+_this.windowId);
_this.eventEmitter.publish('modeChange.' + _this.windowId, 'displayAnnotations');
_this.eventEmitter.publish('DEFAULT_CURSOR.' + _this.windowId);
_this.eventEmitter.publish(('windowUpdated'), {
id: _this.windowId,
annotationState: to
Expand All @@ -114,6 +116,7 @@
_this.eventEmitter.publish('HUD_REMOVE_CLASS.'+_this.windowId, ['.mirador-osd-edit-mode', 'selected']);
_this.eventEmitter.publish('HUD_ADD_CLASS.'+_this.windowId, ['.mirador-osd-'+shape+'-mode', 'selected']);
_this.eventEmitter.publish('modeChange.' + _this.windowId, 'creatingAnnotation');
_this.eventEmitter.publish('CROSSHAIR_CURSOR.' + _this.windowId);
_this.eventEmitter.publish('toggleDrawingTool.'+_this.windowId, shape);

_this.eventEmitter.publish(('windowUpdated'), {
Expand All @@ -125,6 +128,7 @@
_this.eventEmitter.publish('HUD_REMOVE_CLASS.'+_this.windowId, ['.mirador-osd-pointer-mode', 'selected']);
_this.eventEmitter.publish('HUD_REMOVE_CLASS.'+_this.windowId, ['.mirador-osd-edit-mode', 'selected']);
_this.eventEmitter.publish('HUD_ADD_CLASS.'+_this.windowId, ['.mirador-osd-'+shape+'-mode', 'selected']);
_this.eventEmitter.publish('CROSSHAIR_CURSOR.' + _this.windowId);
//don't need to trigger a mode change, just change tool
_this.eventEmitter.publish('toggleDrawingTool.'+_this.windowId, shape);

Expand Down
7 changes: 7 additions & 0 deletions js/src/widgets/imageView.js
Expand Up @@ -157,6 +157,13 @@
_this.hud.annoState.choosePointer();
}
});

_this.eventEmitter.subscribe('DEFAULT_CURSOR.' + _this.windowId, function(event) {
jQuery(_this.osd.canvas).css("cursor", "default");
});
_this.eventEmitter.subscribe('CROSSHAIR_CURSOR.' + _this.windowId, function(event) {
jQuery(_this.osd.canvas).css("cursor", "crosshair");
});
//Related to Annotations HUD
},

Expand Down

0 comments on commit a3ee97f

Please sign in to comment.