Commit 3114e166 authored by ZeMKI's avatar ZeMKI
Browse files

Update newstudy.vue

* bugfixed on token name: you can't insert / in the token name.
parent 4d9f7499
......@@ -153,14 +153,15 @@
<div class="card">
<div class="token-img">
<img :id="'token'+index" src="" alt=""
style=" height: 100%;width: 100%;vertical-align: bottom; margin:auto;">
style="height: 100%; width: 100%; vertical-align: bottom; margin:auto;">
</div>
<div class="card-content">
<div class="content">
<label class="label is-small">Token name</label>
<input
class="input is-small bg-gray-200 focus:bg-white border-transparent focus:border-blue-400"
type="text" v-model="t.name"/>
type="text" v-model="t.name"
@input="validatetokenname(index,t.name)"/>
<label class="label is-small mt-5">Preset tokens</label>
<v-select :options="preset" label="basename" v-model="t.file"
......@@ -600,7 +601,7 @@
if (detailsArray[1]) this.sorting.description = detailsArray[1].substr(detailsArray[1].indexOf('|') + 1);
else this.sorting.description = "";
if(detailsArray[2]) this.sorting.classifier = {name: detailsArray[2].substr(detailsArray[2].indexOf('|') + 1)};
if (detailsArray[2]) this.sorting.classifier = {name: detailsArray[2].substr(detailsArray[2].indexOf('|') + 1)};
let self = this;
this.sorting.tokennumber = this.studydata.tokens.length;
......@@ -857,7 +858,6 @@
_.merge(study, {name: this.name}, {author: this.author}, {description: this.short_description}, {sorting: this.sorting}, {presort: this.presort}, {postsort: this.postsort});
window.axios.post('../studies', study).then(response => {
if (response.message) this.response = response.message;
else {
this.$buefy.snackbar.open(response.data.message);
......@@ -866,8 +866,6 @@
setTimeout(function () {
window.location.href = '../';
}, 1000);
this.loading = false;
}).catch(error => {
......@@ -999,13 +997,20 @@
// fill image in dest. rectangle
ctx.drawImage(img, cx, cy, cw, ch, x, y, w, h);
},
validatetokenname: function (index, name) {
name = name.split('/').join('');
this.sorting.tokens[index].name = name;
},
settokenname: function (index) {
this.sorting.tokens[index].ispreset = false;
this.sorting.tokens[index].image_path = "";
if (!this.fetching) {
if (!this.fetching) {
let reader = new FileReader();
let file = this.sorting.tokens[index].file;
let self = this;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment