Fix empty wishlist after page load
This commit is contained in:
parent
eaee8c223c
commit
b281ff8af5
1 changed files with 18 additions and 4 deletions
|
@ -50,7 +50,7 @@ $(function () {
|
||||||
|
|
||||||
$('.ui.dropdown.wishlists')
|
$('.ui.dropdown.wishlists')
|
||||||
.dropdown({
|
.dropdown({
|
||||||
onChange : function(wishlist_id, text, $choice) {
|
onChange : function(wishlist_id, text, choice) {
|
||||||
wishthis.$_GET.id = wishlist_id;
|
wishthis.$_GET.id = wishlist_id;
|
||||||
|
|
||||||
if (wishlist_id) {
|
if (wishlist_id) {
|
||||||
|
@ -82,14 +82,28 @@ $(function () {
|
||||||
urlParams.set('id', wishlist_id);
|
urlParams.set('id', wishlist_id);
|
||||||
|
|
||||||
updateURL();
|
updateURL();
|
||||||
|
/** */
|
||||||
/** Get wishlist cards/wishes */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Trigger priorities dropdown
|
* Trigger priorities dropdown
|
||||||
*/
|
*/
|
||||||
// $('.ui.dropdown.filter.priority').api('query');
|
$('.ui.dropdown.filter.priority').api('query');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Very dirty hack to ensure the wishes are going to be
|
||||||
|
* displayed after the page has laoded.
|
||||||
|
*/
|
||||||
|
setTimeout(function dropdown_wishlists_api() {
|
||||||
|
var api_is_complete = $('.ui.dropdown.filter.priority').api('was complete');
|
||||||
|
|
||||||
|
if ('' === $('.wishlist-cards').html() && api_is_complete) {
|
||||||
|
$('.ui.dropdown.filter.priority').api('query');
|
||||||
|
|
||||||
|
setTimeout(dropdown_wishlists_api, 1);
|
||||||
|
}
|
||||||
|
}, 1);
|
||||||
/** */
|
/** */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
const get_wishes = new URLSearchParams(
|
const get_wishes = new URLSearchParams(
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue