Commit 26d2f283 authored by ZeMKI's avatar ZeMKI
Browse files

Optimization and solve issue

Fixes #16
parent 6744a427
......@@ -836,8 +836,10 @@ $(document).ready(function () {
}, false);
},
created: function created() {
var _this = this;
// if there is an id
this.interview.timestart = this.calculateDateTime(); // debug tool
this.interview.timestart = this.calculateDateTime();
 
if (this.gotos) {
this.interview.currentpage = 1;
......@@ -845,6 +847,11 @@ $(document).ready(function () {
 
 
if (this.questions.presort.length == 0) this.nextpage();
window.addEventListener('keydown', function (e) {
if (e.keyCode == 66 && e.ctrlKey) {
_this.debugMode();
}
});
},
methods: {
calculateDateTime: function calculateDateTime() {
......@@ -923,7 +930,7 @@ $(document).ready(function () {
return this.interview.currentpage == 2 && this.questions.postsort.length == 0;
},
confirmnextpage: function confirmnextpage() {
var _this = this;
var _this2 = this;
 
console.log(this.notLastPage() && !(this.interview.currentpage == 2 && this.questions.postsort.length > 0));
console.log(this.lastPage() || this.noPostSortQuestions());
......@@ -936,7 +943,7 @@ $(document).ready(function () {
type: 'is-success',
hasIcon: true,
onConfirm: function onConfirm() {
return _this.nextpage();
return _this2.nextpage();
}
});
} else if (this.lastPage() || this.noPostSortQuestions()) {
......@@ -948,13 +955,13 @@ $(document).ready(function () {
type: 'is-success',
hasIcon: true,
onConfirm: function onConfirm() {
return _this.saveinterview();
return _this2.saveinterview();
}
});
}
},
confirmpreviouspage: function confirmpreviouspage() {
var _this2 = this;
var _this3 = this;
 
this.$dialog.confirm({
title: 'Previous Section',
......@@ -963,7 +970,7 @@ $(document).ready(function () {
type: 'is-success',
hasIcon: true,
onConfirm: function onConfirm() {
return _this2.previouspage();
return _this3.previouspage();
}
});
},
......@@ -1004,7 +1011,7 @@ $(document).ready(function () {
}
},
saveinterview: function saveinterview() {
var _this3 = this;
var _this4 = this;
 
this.interview.timeend = this.calculateDateTime();
var interview = {};
......@@ -1026,9 +1033,9 @@ $(document).ready(function () {
});
 
window.axios.post('../interviews', interview).then(function (response) {
_this3.disableinput = true;
_this4.disableinput = true;
 
_this3.$toast.open({
_this4.$toast.open({
message: response.data + ' redirecting to home . . .',
type: 'is-success'
});
......@@ -1037,9 +1044,9 @@ $(document).ready(function () {
window.location.href = '../';
}, 1000);
}).catch(function (error) {
_this3.disableinput = false;
_this4.disableinput = false;
 
_this3.$toast.open({
_this4.$toast.open({
message: error + ' error - Interview not saved',
type: 'is-danger'
});
......@@ -1372,11 +1379,6 @@ __webpack_require__.r(__webpack_exports__);
//
 
 
$(document).on('keydown', function (e) {
if ((e.keyCode == 8 || e.keyCode == 46) && $('#numberoftokens').is(":focus") && $('#numberoftokens').val().length < 2) {
e.preventDefault();
}
});
/* harmony default export */ __webpack_exports__["default"] = ({
props: {
isedit: String / Boolean,
......@@ -1457,6 +1459,14 @@ $(document).on('keydown', function (e) {
created: function created() {
// if there is an id
// load the studyda resource by corresponding id and fill the inputs
setTimeout(function () {
document.getElementById('sortingDescription').addEventListener('keydown', function (e) {
if (e.keyCode == 220) {
e.preventDefault();
}
});
}, 50);
if (this.isedit) {
this.fetching = true; // study info
 
......@@ -13869,7 +13879,11 @@ var render = function() {
}
],
staticClass: "input",
attrs: { type: "text", placeholder: "" },
attrs: {
id: "sortingDescription",
type: "text",
placeholder: ""
},
domProps: { value: _vm.sorting.description },
on: {
input: function($event) {
{
"/js/app.js": "/js/app.js?id=c137197b02daa7012dbd",
"/js/app.js": "/js/app.js?id=ce5790be0386fcc4f2fa",
"/css/app.css": "/css/app.css?id=33e8c8db759d1aed6c23",
"/css/app_dompdf.css": "/css/app_dompdf.css?id=225174786ee9d00fe897",
"/js/manifest.js": "/js/manifest.js?id=844cdbfe9e6b6b56ae8f",
......
......@@ -240,7 +240,7 @@
this.interview.timestart = this.calculateDateTime();
// debug tool
if (this.gotos) {
this.interview.currentpage = 1;
}
......@@ -249,6 +249,12 @@
if (this.questions.presort.length == 0) this.nextpage();
window.addEventListener('keydown', (e) => {
if (e.keyCode == 66 && e.ctrlKey) {
this.debugMode();
}
});
},
methods: {
......
......@@ -43,7 +43,7 @@
<div class="field">
<label class="label">Description</label>
<div class="control">
<input v-model="sorting.description" class="input" type="text" placeholder="">
<input v-model="sorting.description" class="input" id="sortingDescription" type="text" placeholder="">
</div>
</div>
</div>
......@@ -299,11 +299,7 @@
import ArrowLeft from "vue-material-design-icons/ArrowLeft.vue"
import ArrowRight from "vue-material-design-icons/ArrowRight.vue"
$(document).on('keydown', function (e) {
if ((e.keyCode == 8 || e.keyCode == 46) && $('#numberoftokens').is(":focus") && $('#numberoftokens').val().length < 2) {
e.preventDefault();
}
});
export default {
props: {
......@@ -395,6 +391,18 @@
created() {
// if there is an id
// load the studyda resource by corresponding id and fill the inputs
setTimeout(function() {
document.getElementById('sortingDescription').addEventListener('keydown', (e) => {
if ((e.keyCode == 220)) {
e.preventDefault();
}
});
}
, 50);
if (this.isedit) {
this.fetching = true;
// study info
......
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