@cogic/annotorious 2.7.20 → 2.7.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
package/dist/index.html CHANGED
@@ -1,11 +1,4 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <title>Annotorious | Basic Example</title>
6
- <link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet">
7
- <style>
8
- html, body {
1
+ <!doctype html><html><head><meta charset="utf-8"/><title>Annotorious | Basic Example</title><link href="https://fonts.googleapis.com/css?family=Lato&display=swap" rel="stylesheet"><style>html, body {
9
2
  padding:20px;
10
3
  margin:0px;
11
4
  font-family:'Lato', sans-serif;
@@ -37,25 +30,7 @@
37
30
 
38
31
  p.caption a {
39
32
  color:#3f3f3f;
40
- }
41
- </style>
42
- </head>
43
- <body>
44
- <div id="content">
45
- <h1>Annotorious: Basic Example</h1>
46
- <p class="instructions">
47
- Click the annotation to edit. Click and drag the mouse to create a new annotation.
48
- </p>
49
- <p>
50
- <button id="current-tool">RECTANGLE</button>
51
- </p>
52
- <div>
53
- <img id="hallstatt" src="640px-Hallstatt.jpg">
54
- </div>
55
- </div>
56
- </div>
57
- <script>
58
- window.onload = function() {
33
+ }</style><link href="annotorious.min.css" rel="stylesheet"><script src="annotorious.min.js"></script></head><body><div id="content"><h1>Annotorious: Basic Example</h1><p class="instructions">Click the annotation to edit. Click and drag the mouse to create a new annotation.</p><p><button id="current-tool">RECTANGLE</button></p><div><img id="hallstatt" src="640px-Hallstatt.jpg"></div></div><script>window.onload = function() {
59
34
  anno = Annotorious.init({
60
35
  image: 'hallstatt',
61
36
  locale: 'auto',
@@ -134,7 +109,4 @@
134
109
  anno.setDrawingTool('rect');
135
110
  }
136
111
  });
137
- }
138
- </script>
139
- </body>
140
- </html>
112
+ }</script></body></html>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cogic/annotorious",
3
- "version": "2.7.20",
3
+ "version": "2.7.21",
4
4
  "description": "A JavaScript image annotation library",
5
5
  "main": "dist/annotorious.min.js",
6
6
  "scripts": {
@@ -12,9 +12,12 @@ export default class RubberbandRectTool extends Tool {
12
12
  super(g, config, env);
13
13
 
14
14
  this.rubberband = null;
15
+ this._startOnSingleClick = false;
15
16
  }
16
17
 
17
- startDrawing = (x, y) => {
18
+ startDrawing = (x, y, startOnSingleClick) => {
19
+ this._startOnSingleClick = startOnSingleClick;
20
+
18
21
  this.attachListeners({
19
22
  mouseMove: this.onMouseMove,
20
23
  mouseUp: this.onMouseUp
@@ -56,11 +59,11 @@ export default class RubberbandRectTool extends Tool {
56
59
 
57
60
  // Emit the completed shape...
58
61
  this.emit('complete', element);
59
- } else {
62
+ this.stop();
63
+ } else if (!this._startOnSingleClick) {
60
64
  this.emit('cancel');
65
+ this.stop();
61
66
  }
62
-
63
- this.stop();
64
67
  }
65
68
 
66
69
  get isDrawing() {