Extension list UI improvements (#769)

* Extensions list is now sorted alphabetically

* Added extension list search

* Prettified changes

* Removed console.log

* Code improvements based on motorina0 feedback

* Remove console.log from lnbits/templates/base.html

Run prettier
This commit is contained in:
blackcoffeexbt
2022-07-23 10:46:30 +02:00
committed by GitHub
parent 96af5fc3a7
commit c0c26fb98e
4 changed files with 52 additions and 4 deletions
+6 -2
View File
@@ -392,7 +392,7 @@ window.windowMixin = {
}
if (window.extensions) {
var user = this.g.user
this.g.extensions = Object.freeze(
const extensions = Object.freeze(
window.extensions
.map(function (data) {
return window.LNbits.map.extension(data)
@@ -413,9 +413,13 @@ window.windowMixin = {
return obj
})
.sort(function (a, b) {
return a.name > b.name
const nameA = a.name.toUpperCase()
const nameB = b.name.toUpperCase()
return nameA < nameB ? -1 : nameA > nameB ? 1 : 0
})
)
this.g.extensions = extensions
}
}
}