Add progressbar for wishlist products
This commit is contained in:
parent
271a018fb8
commit
bdaab5d66f
4 changed files with 30 additions and 0 deletions
6
src/assets/css/wishlists.css
Normal file
6
src/assets/css/wishlists.css
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
/**
|
||||||
|
* Progress
|
||||||
|
*/
|
||||||
|
.ui.progress {
|
||||||
|
display: none;
|
||||||
|
}
|
|
@ -33,10 +33,15 @@ $(function () {
|
||||||
/**
|
/**
|
||||||
* Selection
|
* Selection
|
||||||
*/
|
*/
|
||||||
|
var progress = $('.ui.progress');
|
||||||
|
|
||||||
$(document).on('change', '.ui.dropdown.wishlists', function () {
|
$(document).on('change', '.ui.dropdown.wishlists', function () {
|
||||||
var wishlistValue = $('.ui.dropdown.wishlists').dropdown('get value');
|
var wishlistValue = $('.ui.dropdown.wishlists').dropdown('get value');
|
||||||
var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1;
|
var wishlistIndex = $('.ui.dropdown.wishlists select').prop('selectedIndex') - 1;
|
||||||
|
|
||||||
|
progress.progress('reset');
|
||||||
|
progress.addClass('indeterminate');
|
||||||
|
|
||||||
$('[name="wishlist_delete_id"]').val(wishlistValue);
|
$('[name="wishlist_delete_id"]').val(wishlistValue);
|
||||||
|
|
||||||
if (wishlistValue) {
|
if (wishlistValue) {
|
||||||
|
@ -66,6 +71,18 @@ $(function () {
|
||||||
/**
|
/**
|
||||||
* Generate cache
|
* Generate cache
|
||||||
*/
|
*/
|
||||||
|
var cards = $('.ui.card[data-cache="false"]');
|
||||||
|
|
||||||
|
if (cards.length > 0) {
|
||||||
|
progress.slideDown();
|
||||||
|
progress.removeClass('indeterminate');
|
||||||
|
progress.progress({
|
||||||
|
total: cards.length
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
progress.slideUp();
|
||||||
|
}
|
||||||
|
|
||||||
var timerInterval = 1200;
|
var timerInterval = 1200;
|
||||||
var timerCache = setTimeout(
|
var timerCache = setTimeout(
|
||||||
function generateCacheCards() {
|
function generateCacheCards() {
|
||||||
|
@ -194,6 +211,7 @@ $(function () {
|
||||||
* Finish
|
* Finish
|
||||||
*/
|
*/
|
||||||
card.removeClass('loading');
|
card.removeClass('loading');
|
||||||
|
progress.progress('increment');
|
||||||
}
|
}
|
||||||
|
|
||||||
refresh.removeClass('working');
|
refresh.removeClass('working');
|
||||||
|
|
|
@ -68,6 +68,12 @@ $page->navigation();
|
||||||
|
|
||||||
<h2 class="ui header">Products</h2>
|
<h2 class="ui header">Products</h2>
|
||||||
|
|
||||||
|
<div class="ui primary progress">
|
||||||
|
<div class="bar">
|
||||||
|
<div class="progress"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="wishlist-cards"></div>
|
<div class="wishlist-cards"></div>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
Loading…
Reference in a new issue