mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix #4011
This commit is contained in:
2
public/v1/js/create_transaction.js
vendored
2
public/v1/js/create_transaction.js
vendored
File diff suppressed because one or more lines are too long
2
public/v1/js/edit_transaction.js
vendored
2
public/v1/js/edit_transaction.js
vendored
File diff suppressed because one or more lines are too long
@@ -110,20 +110,7 @@ export default {
|
||||
aSyncFunction: function (query, done) {
|
||||
axios.get(this.categoryAutoCompleteURI + query)
|
||||
.then(res => {
|
||||
// loop over data
|
||||
let escapedData = [];
|
||||
let current;
|
||||
for (const key in res.data) {
|
||||
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||
current = res.data[key];
|
||||
//current.name_html = res.data[key].name;
|
||||
//current.name = this.escapeHtml(res.data[key].name);
|
||||
|
||||
//current.name = res.data[key].name;
|
||||
escapedData.push(current);
|
||||
}
|
||||
}
|
||||
done(escapedData);
|
||||
done(res.data);
|
||||
})
|
||||
.catch(err => {
|
||||
// any error handler
|
||||
|
@@ -53,7 +53,15 @@
|
||||
:target="target"
|
||||
item-key="description"
|
||||
v-on:input="selectedItem"
|
||||
></typeahead>
|
||||
>
|
||||
<template slot="item" slot-scope="props">
|
||||
<li v-for="(item, index) in props.items" :class="{active:props.activeIndex===index}">
|
||||
<a role="button" @click="props.select(item)">
|
||||
<span v-html="betterHighlight(item)"></span>
|
||||
</a>
|
||||
</li>
|
||||
</template>
|
||||
</typeahead>
|
||||
<ul v-for="error in this.error" class="list-unstyled">
|
||||
<li class="text-danger">{{ error }}</li>
|
||||
</ul>
|
||||
@@ -83,23 +91,17 @@ export default {
|
||||
aSyncFunction: function (query, done) {
|
||||
axios.get(this.descriptionAutoCompleteURI + query)
|
||||
.then(res => {
|
||||
|
||||
// loop over data
|
||||
let escapedData = [];
|
||||
let current;
|
||||
for (const key in res.data) {
|
||||
if (res.data.hasOwnProperty(key) && /^0$|^[1-9]\d*$/.test(key) && key <= 4294967294) {
|
||||
current = res.data[key];
|
||||
current.description = this.escapeHtml(res.data[key].description)
|
||||
escapedData.push(current);
|
||||
}
|
||||
}
|
||||
done(escapedData);
|
||||
done(res.data);
|
||||
})
|
||||
.catch(err => {
|
||||
// any error handler
|
||||
})
|
||||
},
|
||||
betterHighlight: function (item) {
|
||||
var inputValue = this.$refs.descr.value.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
|
||||
var escapedName = this.escapeHtml(item.description);
|
||||
return escapedName.replace(new RegExp(("" + inputValue), 'i'), '<b>$&</b>');
|
||||
},
|
||||
escapeHtml: function (string) {
|
||||
|
||||
let entityMap = {
|
||||
|
@@ -1686,9 +1686,9 @@ caniuse-api@^3.0.0:
|
||||
lodash.uniq "^4.5.0"
|
||||
|
||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001135:
|
||||
version "1.0.30001151"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001151.tgz#1ddfde5e6fff02aad7940b4edb7d3ac76b0cb00b"
|
||||
integrity sha512-Zh3sHqskX6mHNrqUerh+fkf0N72cMxrmflzje/JyVImfpknscMnkeJrlFGJcqTmaa0iszdYptGpWMJCRQDkBVw==
|
||||
version "1.0.30001153"
|
||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001153.tgz#9a0942fe777cd7178fb084693b79415ff747ecd9"
|
||||
integrity sha512-qv14w7kWwm2IW7DBvAKWlCqGTmV2XxNtSejJBVplwRjhkohHuhRUpeSlPjtu9erru0+A12zCDUiSmvx/AcqVRA==
|
||||
|
||||
chalk@^1.1.3:
|
||||
version "1.1.3"
|
||||
|
Reference in New Issue
Block a user