mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2024-11-20 02:28:10 +01:00
c0c26fb98e
* 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
37 lines
879 B
JavaScript
37 lines
879 B
JavaScript
new Vue({
|
|
el: '#vue',
|
|
data: function () {
|
|
return {
|
|
searchTerm: '',
|
|
filteredExtensions: null
|
|
}
|
|
},
|
|
mounted() {
|
|
this.filteredExtensions = this.g.extensions
|
|
},
|
|
watch: {
|
|
searchTerm(term) {
|
|
// Reset the filter
|
|
this.filteredExtensions = this.g.extensions
|
|
if (term !== '') {
|
|
// Filter the extensions list
|
|
function extensionNameContains(searchTerm) {
|
|
return function (extension) {
|
|
return (
|
|
extension.name.toLowerCase().includes(searchTerm.toLowerCase()) ||
|
|
extension.shortDescription
|
|
.toLowerCase()
|
|
.includes(searchTerm.toLowerCase())
|
|
)
|
|
}
|
|
}
|
|
|
|
this.filteredExtensions = this.filteredExtensions.filter(
|
|
extensionNameContains(term)
|
|
)
|
|
}
|
|
}
|
|
},
|
|
mixins: [windowMixin]
|
|
})
|