Merge branch '94-action-listener-for-butttons' into 'master'
Resolve "Action listener for Butttons" Closes #94 See merge request marcel.schwarz/2020ss-qbc-geofence-timetracking!74
This commit is contained in:
commit
08b996308f
@ -1,5 +1,5 @@
|
||||
<template >
|
||||
<v-container>
|
||||
<v-container id = "createAccountListen">
|
||||
<v-card align-center>
|
||||
<h3 class="text-center display-2 logowhite--text">Details</h3>
|
||||
|
||||
@ -79,5 +79,15 @@ export default {
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
var listen = document.getElementById('createAccountListen');
|
||||
listen.addEventListener("keyup", e => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.addAccount();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,5 +1,5 @@
|
||||
<template >
|
||||
<v-container>
|
||||
<v-container id = "createRecordListen">
|
||||
<v-card align-center>
|
||||
<h3 class="text-center display-2 logowhite--text">Details</h3>
|
||||
|
||||
@ -61,30 +61,38 @@ export default {
|
||||
var account = "";
|
||||
var accountxhttp = new XMLHttpRequest();
|
||||
|
||||
|
||||
accountxhttp.onreadystatechange = function() {
|
||||
if ((this.status == 200) & (this.readyState == 4)) {
|
||||
|
||||
//account =
|
||||
|
||||
account =JSON.parse(accountxhttp.responseText)
|
||||
|
||||
account = JSON.parse(accountxhttp.responseText);
|
||||
|
||||
account = account._links.self.href;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
};
|
||||
accountxhttp.open("GET", baseUri + "/accounts/search/findByUsernameAndName?username=" + sessionStorage.getItem("username")+ "&account=" +this.accountname, false);
|
||||
accountxhttp.open(
|
||||
"GET",
|
||||
baseUri +
|
||||
"/accounts/search/findByUsernameAndName?username=" +
|
||||
sessionStorage.getItem("username") +
|
||||
"&account=" +
|
||||
this.accountname,
|
||||
false
|
||||
);
|
||||
accountxhttp.setRequestHeader("Content-Type", "application/json");
|
||||
|
||||
accountxhttp.setRequestHeader("Authorization", sessionStorage.getItem("jwt"));
|
||||
accountxhttp.setRequestHeader(
|
||||
"Authorization",
|
||||
sessionStorage.getItem("jwt")
|
||||
);
|
||||
accountxhttp.send(null);
|
||||
|
||||
|
||||
if (this.newstartdate != "" && this.newenddate != "" && this.newdate != "" && account != "" ) {
|
||||
if (
|
||||
this.newstartdate != "" &&
|
||||
this.newenddate != "" &&
|
||||
this.newdate != "" &&
|
||||
account != ""
|
||||
) {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
var suc;
|
||||
xhttp.onreadystatechange = function() {
|
||||
@ -112,7 +120,18 @@ export default {
|
||||
this.$router.push("/timerecords");
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
var listen = document.getElementById('createRecordListen');
|
||||
|
||||
listen.addEventListener("keyup", e => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.addRecord();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,5 +1,5 @@
|
||||
<template >
|
||||
<v-container>
|
||||
<v-container id = "editAccountListen">
|
||||
<v-card align-center>
|
||||
<div class="text-center ma-3">
|
||||
<h2 class="text-center display-2 logowhite--text">Account to edit:</h2>
|
||||
@ -115,6 +115,16 @@ export default {
|
||||
this.newrevenue = account.revenue;
|
||||
this.newdescription = account.description;
|
||||
|
||||
},
|
||||
mounted() {
|
||||
var listen = document.getElementById('editAccountListen');
|
||||
listen.addEventListener("keyup", e => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.editAccount();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,5 +1,5 @@
|
||||
<template >
|
||||
<v-container>
|
||||
<v-container id="editRecordListen">
|
||||
|
||||
|
||||
<v-card align-center>
|
||||
@ -111,6 +111,16 @@ export default {
|
||||
this.newstartdate = record.startdate;
|
||||
this.newenddate = record.enddate;
|
||||
|
||||
},
|
||||
mounted() {
|
||||
var listen = document.getElementById('editRecordListen');
|
||||
listen.addEventListener("keyup", e => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
|
||||
this.editRecord();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
@ -1,5 +1,5 @@
|
||||
<template >
|
||||
<v-container class="fill-height">
|
||||
<v-container class="fill-height" id="signInListen">
|
||||
<v-row align="center" justify="center">
|
||||
<v-col cols="12">
|
||||
<v-card elevation="0">
|
||||
@ -171,7 +171,8 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
window.addEventListener('keyup', (e) => {
|
||||
var listen = document.getElementById('signInListen');
|
||||
listen.addEventListener('keyup', (e) => {
|
||||
if (e.keyCode === 13) {
|
||||
e.preventDefault();
|
||||
if(this.step==1){
|
||||
|
Loading…
Reference in New Issue
Block a user