♻️ Refactor Functions
This commit is contained in:
@@ -7,7 +7,7 @@ import * as querystring from "querystring";
|
||||
* output this: 'msg1=value1&msg2=value2'
|
||||
* @param dataArguments
|
||||
*/
|
||||
function joinDataArguments(dataArguments) {
|
||||
let joinDataArguments=(dataArguments)=> {
|
||||
let data = "";
|
||||
dataArguments.forEach((argument, i) => {
|
||||
if (i === 0) {
|
||||
|
||||
@@ -93,7 +93,7 @@ export default {
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
"requestUpdateData.collectionIndex": function resetFolderIndex() {
|
||||
"requestUpdateData.collectionIndex": ()=> { //resetFolderIndex Function
|
||||
// if user choosen some folder, than selected other collection, which doesn't have any folders
|
||||
// than `requestUpdateData.folderIndex` won't be reseted
|
||||
this.$data.requestUpdateData.folderIndex = undefined;
|
||||
|
||||
@@ -119,7 +119,7 @@ export default {
|
||||
this.$data.requestData.folderIndex = undefined;
|
||||
this.$data.requestData.requestIndex = undefined;
|
||||
},
|
||||
"requestData.folderIndex": function resetRequestIndex() {
|
||||
"requestData.folderIndex": ()=> {
|
||||
this.$data.requestData.requestIndex = undefined;
|
||||
}
|
||||
},
|
||||
|
||||
@@ -923,7 +923,7 @@ export default {
|
||||
if (status && this.rawParams === "") this.rawParams = "{}";
|
||||
else this.setRouteQueryState();
|
||||
},
|
||||
"response.body": function(val) {
|
||||
"response.body": (val)=> {
|
||||
if (
|
||||
this.response.body === "(waiting to send request)" ||
|
||||
this.response.body === "Loading..."
|
||||
@@ -947,7 +947,7 @@ export default {
|
||||
}
|
||||
},
|
||||
params: {
|
||||
handler: function(newValue) {
|
||||
handler: (newValue)=> {
|
||||
if (!this.paramsWatchEnabled) {
|
||||
this.paramsWatchEnabled = true;
|
||||
return;
|
||||
@@ -1984,7 +1984,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.observeRequestButton();
|
||||
this._keyListener = function(e) {
|
||||
this._keyListener = (e)=> {
|
||||
if (e.key === "g" && (e.ctrlKey || e.metaKey)) {
|
||||
e.preventDefault();
|
||||
this.sendRequest();
|
||||
|
||||
@@ -432,8 +432,8 @@ export default {
|
||||
this.sse.close();
|
||||
}
|
||||
},
|
||||
updated: function() {
|
||||
this.$nextTick(function() {
|
||||
updated: ()=> {
|
||||
this.$nextTick(()=> {
|
||||
const divLog = document.getElementById("log");
|
||||
divLog.scrollBy(0, divLog.scrollHeight + 100);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user