kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix bug in Spinner where some query history items didn't work.
rodzic
5cabe5ecfa
commit
83b0309f23
|
@ -78,21 +78,23 @@
|
||||||
let history = getQueryHistory();
|
let history = getQueryHistory();
|
||||||
|
|
||||||
if (history.length > 0) {
|
if (history.length > 0) {
|
||||||
|
let i = 0;
|
||||||
for (let item of history) {
|
for (let item of history) {
|
||||||
container.innerHTML += `
|
container.innerHTML += `
|
||||||
<tr>
|
<tr>
|
||||||
<td><button onclick="onHistoryItemClicked('${item}')">^</button></td>
|
<td><button onclick="onHistoryItemClicked(${i})">^</button></td>
|
||||||
<td>${item}</td>
|
<td id="history-item-${i}">${item}</td>
|
||||||
</tr>
|
</tr>
|
||||||
`
|
`;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
container.innerHTML = '<em>None</em>'
|
container.innerHTML = '<em>None</em>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onHistoryItemClicked(item) {
|
function onHistoryItemClicked(i) {
|
||||||
document.querySelector('.query-input').value = item;
|
document.querySelector('.query-input').value = document.getElementById(`history-item-${i}`).innerText;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getQueryHistory() {
|
function getQueryHistory() {
|
||||||
|
|
Ładowanie…
Reference in New Issue