Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ZeMKI
Mesort
Commits
26d2f283
Commit
26d2f283
authored
Aug 08, 2019
by
ZeMKI
Browse files
Optimization and solve issue
Fixes
#16
parent
6744a427
Changes
4
Hide whitespace changes
Inline
Side-by-side
public/js/app.js
View file @
26d2f283
...
...
@@ -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 _this
2
= 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 _this
2
.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 _this
2
.saveinterview();
}
});
}
},
confirmpreviouspage: function confirmpreviouspage() {
var _this
2
= this;
var _this
3
= this;
this.$dialog.confirm({
title: 'Previous Section',
...
...
@@ -963,7 +970,7 @@ $(document).ready(function () {
type: 'is-success',
hasIcon: true,
onConfirm: function onConfirm() {
return _this
2
.previouspage();
return _this
3
.previouspage();
}
});
},
...
...
@@ -1004,7 +1011,7 @@ $(document).ready(function () {
}
},
saveinterview: function saveinterview() {
var _this
3
= this;
var _this
4
= this;
this.interview.timeend = this.calculateDateTime();
var interview = {};
...
...
@@ -1026,9 +1033,9 @@ $(document).ready(function () {
});
window.axios.post('../interviews', interview).then(function (response) {
_this
3
.disableinput = true;
_this
4
.disableinput = true;
_this
3
.$toast.open({
_this
4
.$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) {
_this
3
.disableinput = false;
_this
4
.disableinput = false;
_this
3
.$toast.open({
_this
4
.$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) {
public/mix-manifest.json
View file @
26d2f283
{
"/js/app.js"
:
"/js/app.js?id=c
137197b02daa7012dbd
"
,
"/js/app.js"
:
"/js/app.js?id=c
e5790be0386fcc4f2fa
"
,
"/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"
,
...
...
resources/js/components/newinterview.vue
View file @
26d2f283
...
...
@@ -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
:
{
...
...
resources/js/components/newstudy.vue
View file @
26d2f283
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment