|
@@ -9,8 +9,9 @@
|
|
:label="label"
|
|
:label="label"
|
|
@label="label = $event"
|
|
@label="label = $event"
|
|
:labels="labels"
|
|
:labels="labels"
|
|
- @infoBox="toggleInfoBox"
|
|
|
|
:zoomBox="zoomBox"
|
|
:zoomBox="zoomBox"
|
|
|
|
+ :infoBox="infoBox !== false"
|
|
|
|
+ @infoBox="infoBox = $event; interaction=false"
|
|
@unzoom="zoomBox=false; interaction=false"
|
|
@unzoom="zoomBox=false; interaction=false"
|
|
@prevzoom="$refs.overlay.prevZoom()"
|
|
@prevzoom="$refs.overlay.prevZoom()"
|
|
@nextzoom="$refs.overlay.nextZoom()"/>
|
|
@nextzoom="$refs.overlay.nextZoom()"/>
|
|
@@ -48,16 +49,17 @@
|
|
:video="video"
|
|
:video="video"
|
|
:results="results"
|
|
:results="results"
|
|
:labels="labels"
|
|
:labels="labels"
|
|
- @crop="selectCrop($event)"
|
|
|
|
|
|
+ :crop="infoBox"
|
|
|
|
+ @crop="infoBox = $event"
|
|
:zoom="zoomBox"
|
|
:zoom="zoomBox"
|
|
@zoom="zoomBox = $event"/>
|
|
@zoom="zoomBox = $event"/>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
- <cropped-image ref="info"
|
|
|
|
- :width="300"
|
|
|
|
- :margin="10"
|
|
|
|
|
|
+ <cropped-image v-if="infoBox !== false"
|
|
:labels="labels"
|
|
:labels="labels"
|
|
- @closed="infoBoxClosed"/>
|
|
|
|
|
|
+ :file="current"
|
|
|
|
+ :box="infoBox"
|
|
|
|
+ @close="infoBox=false"/>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -75,7 +77,7 @@ export default {
|
|
mounted: function () {
|
|
mounted: function () {
|
|
// add resize listener
|
|
// add resize listener
|
|
window.addEventListener('resize', this.resize);
|
|
window.addEventListener('resize', this.resize);
|
|
- this.interval = setInterval(this.resize, 100);
|
|
|
|
|
|
+ this.interval = setInterval(this.resize, 1000);
|
|
this.resize();
|
|
this.resize();
|
|
|
|
|
|
// add result listener
|
|
// add result listener
|
|
@@ -132,7 +134,7 @@ export default {
|
|
frame: 0,
|
|
frame: 0,
|
|
play: false
|
|
play: false
|
|
},
|
|
},
|
|
- selectedCrop: null,
|
|
|
|
|
|
+ infoBox: false,
|
|
zoomBox: false,
|
|
zoomBox: false,
|
|
supported: {
|
|
supported: {
|
|
labeledImages: false,
|
|
labeledImages: false,
|
|
@@ -183,23 +185,6 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- toggleInfoBox: function () {
|
|
|
|
- let infoBox = this.$refs.info;
|
|
|
|
- infoBox.toggle();
|
|
|
|
- if (infoBox.visible)
|
|
|
|
- this.interaction = "info-box";
|
|
|
|
- else {
|
|
|
|
- this.interaction = false;
|
|
|
|
- this.$refs.overlay.deselectAllBoxes()
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- selectCrop: function (event) {
|
|
|
|
- this.$refs.info.show(event);
|
|
|
|
- },
|
|
|
|
- infoBoxClosed: function () {
|
|
|
|
- this.interaction = false;
|
|
|
|
- this.$refs.overlay.deselectAllBoxes()
|
|
|
|
- },
|
|
|
|
resize: function () {
|
|
resize: function () {
|
|
const rect = this.$refs.root.getBoundingClientRect();
|
|
const rect = this.$refs.root.getBoundingClientRect();
|
|
|
|
|
|
@@ -267,6 +252,9 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
editResult: function (result) {
|
|
editResult: function (result) {
|
|
|
|
+ if (this.infoBox && result.identifier === this.infoBox.identifier)
|
|
|
|
+ this.infoBox = result;
|
|
|
|
+
|
|
for (let i = 0; i < this.results.length; i++) {
|
|
for (let i = 0; i < this.results.length; i++) {
|
|
if (this.results[i].identifier === result.identifier) {
|
|
if (this.results[i].identifier === result.identifier) {
|
|
this.$set(this.results, i, result);
|
|
this.$set(this.results, i, result);
|
|
@@ -322,12 +310,11 @@ export default {
|
|
.then(response => response.json())
|
|
.then(response => response.json())
|
|
.then(results => {
|
|
.then(results => {
|
|
this.results = results;
|
|
this.results = results;
|
|
- })
|
|
|
|
- let infoBox = this.$refs.info;
|
|
|
|
- if (infoBox == undefined)
|
|
|
|
- return;
|
|
|
|
- infoBox.box = null;
|
|
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ infoBox: function () {
|
|
|
|
+ setTimeout(this.resize, 1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|