Merge branch '902-page-reload-on-search' into 'develop'

Resolve "Search playlist unexpectedly triggers keyboard sortcut commands"

Closes #902

See merge request funkwhale/funkwhale!891
This commit is contained in:
Eliot Berriot 2019-09-16 10:00:40 +02:00
commit efd4f38904
5 changed files with 31 additions and 18 deletions

View File

@ -0,0 +1 @@
Fixed search usability issue when browsing artists, albums, radios and playlists (#902)

View File

@ -110,7 +110,7 @@ export default {
result: null, result: null,
page: parseInt(this.defaultPage), page: parseInt(this.defaultPage),
query: this.defaultQuery, query: this.defaultQuery,
tags: this.defaultTags.filter((t) => { return t.length > 0 }) || [], tags: (this.defaultTags || []).filter((t) => { return t.length > 0 }),
paginateBy: parseInt(this.defaultPaginateBy || 25), paginateBy: parseInt(this.defaultPaginateBy || 25),
orderingDirection: defaultOrdering.direction || "+", orderingDirection: defaultOrdering.direction || "+",
ordering: defaultOrdering.field, ordering: defaultOrdering.field,
@ -135,15 +135,18 @@ export default {
}, },
methods: { methods: {
updateQueryString: _.debounce(function() { updateQueryString: _.debounce(function() {
this.$router.replace({ history.pushState(
query: { {},
null,
this.$route.path + '?' + new URLSearchParams(
{
query: this.query, query: this.query,
page: this.page, page: this.page,
tag: this.tags, tag: this.tags,
paginateBy: this.paginateBy, paginateBy: this.paginateBy,
ordering: this.getOrderingAsString() ordering: this.getOrderingAsString()
} }).toString()
}) )
}, 500), }, 500),
fetchData: _.debounce(function() { fetchData: _.debounce(function() {
var self = this var self = this

View File

@ -98,7 +98,7 @@ export default {
result: null, result: null,
page: parseInt(this.defaultPage), page: parseInt(this.defaultPage),
query: this.defaultQuery, query: this.defaultQuery,
tags: this.defaultTags.filter((t) => { return t.length > 0 }) || [], tags: (this.defaultTags || []).filter((t) => { return t.length > 0 }),
paginateBy: parseInt(this.defaultPaginateBy || 30), paginateBy: parseInt(this.defaultPaginateBy || 30),
orderingDirection: defaultOrdering.direction || "+", orderingDirection: defaultOrdering.direction || "+",
ordering: defaultOrdering.field, ordering: defaultOrdering.field,
@ -123,15 +123,18 @@ export default {
}, },
methods: { methods: {
updateQueryString: _.debounce(function() { updateQueryString: _.debounce(function() {
this.$router.replace({ history.pushState(
query: { {},
null,
this.$route.path + '?' + new URLSearchParams(
{
query: this.query, query: this.query,
page: this.page, page: this.page,
tag: this.tags, tag: this.tags,
paginateBy: this.paginateBy, paginateBy: this.paginateBy,
ordering: this.getOrderingAsString() ordering: this.getOrderingAsString()
} }).toString()
}) )
}, 500), }, 500),
fetchData: _.debounce(function() { fetchData: _.debounce(function() {
var self = this var self = this

View File

@ -154,14 +154,17 @@ export default {
}, },
methods: { methods: {
updateQueryString: _.debounce(function() { updateQueryString: _.debounce(function() {
this.$router.replace({ history.pushState(
query: { {},
null,
this.$route.path + '?' + new URLSearchParams(
{
query: this.query, query: this.query,
page: this.page, page: this.page,
paginateBy: this.paginateBy, paginateBy: this.paginateBy,
ordering: this.getOrderingAsString() ordering: this.getOrderingAsString()
} }).toString()
}) )
}, 500), }, 500),
fetchData: _.debounce(function() { fetchData: _.debounce(function() {
var self = this var self = this

View File

@ -113,14 +113,17 @@ export default {
}, },
methods: { methods: {
updateQueryString: _.debounce(function() { updateQueryString: _.debounce(function() {
this.$router.replace({ history.pushState(
query: { {},
null,
this.$route.path + '?' + new URLSearchParams(
{
query: this.query, query: this.query,
page: this.page, page: this.page,
paginateBy: this.paginateBy, paginateBy: this.paginateBy,
ordering: this.getOrderingAsString() ordering: this.getOrderingAsString()
} }).toString()
}) )
}, 250), }, 250),
fetchData: _.debounce(function() { fetchData: _.debounce(function() {
var self = this var self = this