Skip to content

Commit 1e8a351

Browse files
authored
Merge pull request #304 from DigitalSlideArchive/handle-new-feature-event
Handle the mousedown event for better overlay processing.
2 parents 02255da + 8c9e19d commit 1e8a351

File tree

14 files changed

+118
-111
lines changed

14 files changed

+118
-111
lines changed

histomicsui/web_client/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
"webpack": "webpack.helper"
2828
},
2929
"scripts": {
30-
"lint": "eslint --cache . && pug-lint . && stylus-supremacy format --compare ./**/*.styl --options package.json",
31-
"format": "eslint --cache --fix . && stylus-supremacy format ./**/*.styl --replace --options package.json"
30+
"lint": "eslint --cache . && eslint --no-eslintrc -c ./package.json --cache ../../tests && pug-lint . && stylus-supremacy format --compare ./**/*.styl --options package.json",
31+
"format": "eslint --cache --fix . && eslint --no-eslintrc -c ./package.json --cache --fix ../../tests && stylus-supremacy format ./**/*.styl --replace --options package.json"
3232
},
3333
"dependencies": {
3434
"@vue/compiler-sfc": "^3.2.33",

histomicsui/web_client/views/body/ImageView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ var ImageView = View.extend({
220220
// handle overlay events
221221
this.listenTo(this.viewerWidget, 'g:mouseClickAnnotationOverlay', this.mouseClickOverlay);
222222
this.listenTo(this.viewerWidget, 'g:mouseOverAnnotationOverlay', this.mouseOverOverlay);
223+
this.listenTo(this.viewerWidget, 'g:mouseDownAnnotationOverlay', this.mouseOverOverlay);
223224
this.listenTo(this.viewerWidget, 'g:drawOverlayAnnotation', this.overlayLayerDrawn);
224225
this.listenTo(this.viewerWidget, 'g:removeOverlayAnnotation', this.overlayLayerRemoved);
225226

@@ -927,7 +928,7 @@ var ImageView = View.extend({
927928
if (overlayElement.get('type') !== 'pixelmap') { return; }
928929
const overlayAnnotationIsSelected = this.activeAnnotation && this.activeAnnotation.elements().get(overlayElement.id);
929930
const index = overlayElement.get('boundaries') ? (event.index - event.index % 2) : event.index;
930-
if (event.mouse.buttonsDown.left && this.drawWidget && overlayAnnotationIsSelected) {
931+
if (event.mouse.buttonsDown.left && !event.mouse.modifiers.shift && this.drawWidget && overlayAnnotationIsSelected) {
931932
// left click. check what the active style is and if it applies
932933
const style = this.drawWidget.getStyleGroup();
933934
const newIndex = this._getCategoryIndexFromStyleGroup(overlayElement, style);

tests/web_client_specs/.eslintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "girder",
2+
"extends": "@girder",
33
"rules": {
44
"no-template-curly-in-string": 0
55
},

tests/web_client_specs/analysisSpec.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
/* global huiTest */
2-
3-
/* global huiTest */
1+
/* global huiTest girderTest beforeEach girder describe it waitsFor runs $ afterEach expect */
42

53
girderTest.importPlugin('jobs', 'large_image', 'large_image_annotation', 'slicer_cli_web', 'histomicsui');
64
girderTest.addScript('/static/built/plugins/histomicsui/huiTest.js');

tests/web_client_specs/annotationSpec.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global huiTest */
1+
/* global huiTest girderTest beforeEach girder describe it waitsFor runs $ afterEach expect waits _ */
22

33
girderTest.importPlugin('jobs', 'large_image', 'large_image_annotation', 'slicer_cli_web', 'histomicsui');
44
girderTest.addScript('/static/built/plugins/histomicsui/huiTest.js');
@@ -888,15 +888,15 @@ girderTest.promise.done(function () {
888888
$('.h-annotation-select-by-region').click();
889889

890890
interactor.simulateEvent('mousedown', {
891-
map: { x: 100, y: 100 },
891+
map: {x: 100, y: 100},
892892
button: 'left'
893893
});
894894
interactor.simulateEvent('mousemove', {
895-
map: { x: 200, y: 200 },
895+
map: {x: 200, y: 200},
896896
button: 'left'
897897
});
898898
interactor.simulateEvent('mouseup', {
899-
map: { x: 200, y: 200 },
899+
map: {x: 200, y: 200},
900900
button: 'left'
901901
});
902902

@@ -1205,19 +1205,19 @@ girderTest.promise.done(function () {
12051205

12061206
runs(function () {
12071207
var rect = {
1208-
'name': 'rectangle',
1209-
'description': 'the description',
1210-
'elements': [
1208+
name: 'rectangle',
1209+
description: 'the description',
1210+
elements: [
12111211
{
1212-
'center': [
1212+
center: [
12131213
2000,
12141214
2000,
12151215
0
12161216
],
1217-
'height': 4000,
1218-
'rotation': 0,
1219-
'type': 'rectangle',
1220-
'width': 4000
1217+
height: 4000,
1218+
rotation: 0,
1219+
type: 'rectangle',
1220+
width: 4000
12211221
}
12221222
]
12231223
};

tests/web_client_specs/girderUISpec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global girderTest describe it waitsFor runs $ expect _ */
2+
13
girderTest.importPlugin('jobs', 'large_image', 'large_image_annotation', 'slicer_cli_web', 'histomicsui');
24

35
girderTest.startApp();

tests/web_client_specs/huiSpec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
/* globals girder, girderTest, describe, it, expect, waitsFor, runs */
1+
/* globals girder, girderTest, describe, it, expect, waitsFor, runs, $ */
22

33
girderTest.importPlugin('jobs', 'large_image', 'large_image_annotation', 'slicer_cli_web', 'histomicsui');
44

55
girderTest.startApp();
66

77
describe('Test the HistomicsUI plugin', function () {
88
it('change the HistomicsUI settings', function () {
9-
var styles = [{'lineWidth': 8, 'id': 'Sample Group'}];
9+
var styles = [{lineWidth: 8, id: 'Sample Group'}];
1010
var styleJSON = JSON.stringify(styles);
1111

1212
girderTest.login('admin', 'Admin', 'Admin', 'password')();

tests/web_client_specs/huiTest.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* global waitsFor girderTest $ girder runs expect */
2+
13
(function (global) {
24
global.huiTest = {};
35

tests/web_client_specs/itemSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* globals girder, girderTest, describe, it, expect, waitsFor, runs */
1+
/* globals girder, girderTest, describe, it, expect, waitsFor, runs, _, $ */
22

33
girderTest.importPlugin('jobs', 'large_image', 'large_image_annotation', 'slicer_cli_web', 'histomicsui');
44

tests/web_client_specs/metadataPanelSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global huiTest */
1+
/* global huiTest girderTest describe it runs $ expect waitsFor */
22

33
girderTest.importPlugin('jobs', 'large_image', 'large_image_annotation', 'slicer_cli_web', 'histomicsui');
44
girderTest.addScript('/static/built/plugins/histomicsui/huiTest.js');

0 commit comments

Comments
 (0)