This repository was archived by the owner on Feb 14, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-annotator" ,
3
- "version" : " 0.13.1 " ,
3
+ "version" : " 0.13.2 " ,
4
4
"description" : " Vue Component for drawing annotation (box, etc)" ,
5
5
"homepage" : " http://vue-annotator.surge.sh" ,
6
6
"repository" : " github:DrSensor/vue-annotator" ,
Original file line number Diff line number Diff line change @@ -51,10 +51,10 @@ export default {
51
51
this .enableDrawing (value)
52
52
},
53
53
noInteract : function (value ) {
54
- this .enableInteraction (value)
54
+ this .enableInteraction (! value)
55
55
},
56
56
noSelect : function (value ) {
57
- this .enableSelection (value)
57
+ this .enableSelection (! value)
58
58
},
59
59
},
60
60
@@ -105,9 +105,9 @@ export default {
105
105
},
106
106
107
107
mounted () {
108
+ this .background = SVG .adopt (this .$refs .bgSvg )
109
+ this .annotations = SVG .adopt (this .$refs .annotations )
108
110
this .$nextTick (() => {
109
- this .background = SVG .adopt (this .$refs .bgSvg )
110
- this .annotations = SVG .adopt (this .$refs .annotations )
111
111
this .enableSelection (! this .noSelect )
112
112
this .enableInteraction (! this .noInteract )
113
113
this .enableDrawing (this .drawing )
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ function btncode2string (code) {
6
6
if ( code === 0 ) return 'left'
7
7
else if ( code === 1 ) return 'middle'
8
8
else if ( code === 2 ) return 'right'
9
- return ''
9
+ return null
10
10
}
11
11
12
12
export default {
13
13
props : {
14
14
multipleSelect : Boolean ,
15
15
mouseSelect : {
16
- default : '' ,
16
+ default : null ,
17
17
type : String
18
18
}
19
19
} ,
@@ -48,7 +48,7 @@ export default {
48
48
}
49
49
50
50
const selectListener = event => {
51
- if ( this . mouseSelect === btncode2string ( event . button ) ) {
51
+ if ( ! this . mouseSelect || this . mouseSelect === btncode2string ( event . button ) || ! btncode2string ( event . button ) ) {
52
52
const selector = annotator . selectize ( {
53
53
deepSelect : true ,
54
54
rotationPoint : false ,
@@ -72,7 +72,7 @@ export default {
72
72
if ( this . $refs . annotations . hasChildNodes ( ) ) {
73
73
this . $refs . annotations . childNodes . forEach ( ( node , id ) => {
74
74
if ( ! enabled ) {
75
- interact ( node ) . selection . off ( 'tap' )
75
+ interact ( node ) . off ( 'tap' )
76
76
this . background . fire ( 'click' ) // unselect all
77
77
this . background . off ( 'click' )
78
78
} else {
You can’t perform that action at this time.
0 commit comments