Browse Source

Fix bug for updating progress bar

pull/10/head
Hironsan 6 years ago
parent
commit
cf7d12c7f9
3 changed files with 5 additions and 8 deletions
  1. BIN
      doccano/app/db.sqlite3
  2. 11
      doccano/app/server/static/annotation.js
  3. 2
      doccano/app/server/static/main.js

BIN
doccano/app/db.sqlite3

11
doccano/app/server/static/annotation.js

@ -37,7 +37,7 @@ var vm = new Vue({
}, },
methods: { methods: {
addLabel: function (label) {
addLabel: async function (label) {
for (var i = 0; i < this.items[this.cur]['labels'].length; i++) { for (var i = 0; i < this.items[this.cur]['labels'].length; i++) {
var item = this.items[this.cur]['labels'][i]; var item = this.items[this.cur]['labels'][i];
if (label == item.text) { if (label == item.text) {
@ -58,7 +58,7 @@ var vm = new Vue({
'label_id': label2id[label['text']] 'label_id': label2id[label['text']]
}; };
axios.post('/' + base_url + '/apis/data', data)
await axios.post('/' + base_url + '/apis/data', data)
.then(function (response) { .then(function (response) {
console.log('post data'); console.log('post data');
}) })
@ -67,7 +67,7 @@ var vm = new Vue({
}); });
this.updateProgress(); this.updateProgress();
}, },
deleteLabel: function (index) {
deleteLabel: async function (index) {
var label2id = swap(this.labels); var label2id = swap(this.labels);
var label = this.items[this.cur]['labels'][index]; var label = this.items[this.cur]['labels'][index];
var payload = { var payload = {
@ -75,7 +75,7 @@ var vm = new Vue({
'label_id': label2id[label['text']] 'label_id': label2id[label['text']]
}; };
axios.delete('/' + base_url + '/apis/data', {
await axios.delete('/' + base_url + '/apis/data', {
data: payload data: payload
}) })
.then(function (response) { .then(function (response) {
@ -162,9 +162,6 @@ var vm = new Vue({
this.submit(); this.submit();
}, },
computed: { computed: {
done: function () {
return this.total - this.remaining
},
achievement: function () { achievement: function () {
if (this.total == 0) { if (this.total == 0) {
return 0; return 0;

2
doccano/app/server/static/main.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save