Skip to content

Commit eaaf44c

Browse files
Merge pull request #1084 from Codeinwp/changes-speed-and-position-for-the-loading-bar
Changes speed and position for the loading bar
2 parents 124fae4 + 54927d3 commit eaaf44c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

js/setup-wizard.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ jQuery(function ($) {
5353
// Import chart data.
5454
if ( 1 == id ) {
5555
var chartType = $(".vz-radio-btn:checked").val();
56-
var percentBarWidth = 100;
56+
var percentBarWidth = 0;
5757
var loaderDelay;
5858
$.ajax( {
5959
beforeSend: function() {
6060
loaderDelay = setInterval(function () {
6161
$('.vz-progress-bar').css({
62-
width: percentBarWidth-- + '%'
62+
width: percentBarWidth++ + '%'
6363
});
6464
}, 1000);
6565
},
@@ -76,9 +76,9 @@ jQuery(function ($) {
7676
clearInterval( loaderDelay );
7777
loaderDelay = setInterval(function () {
7878
$('.vz-progress-bar').css({
79-
width: percentBarWidth-- + '%'
79+
width: percentBarWidth++ + '%'
8080
});
81-
if ( percentBarWidth <= 0 ) {
81+
if ( percentBarWidth >= 100 ) {
8282
if ( 1 === data.success ) {
8383
var importMessage = jQuery('[data-import_message]');
8484
importMessage
@@ -95,11 +95,14 @@ jQuery(function ($) {
9595
$('#smartwizard').smartWizard('reset');
9696
}
9797
$('.vz-progress-bar').css({
98-
width: 0
98+
width: 100 + '%'
99+
});
100+
$('.vz-progress').css({
101+
visibility: 'hidden'
99102
});
100103
clearInterval( loaderDelay );
101104
}
102-
}, 100 );
105+
}, 36 );
103106
},
104107
error: function() {
105108
$('#step-2').find('.vz-progress-bar').animate({ width: '0' });

templates/setup-wizard.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,23 +178,23 @@ class="btn btn-secondary" target="_blank"><?php esc_html_e( 'Upgrade to Pro', 'v
178178
<h2 class="h2 pb-8"><?php esc_html_e( 'You\'re almost done!', 'visualizer' ); ?></h2>
179179
<p class="p"><?php esc_html_e( 'We use demo data during the import process, don&#x92;t worry you can customize it later', 'visualizer' ); ?></p>
180180
</div>
181-
<div class="vz-progress">
182-
<div class="vz-progress-bar" style="width: 100%;"></div>
183-
</div>
184181
</div>
185182
<div class="vz-accordion-item__content">
186183
<div class="vz-form-wrap">
187-
<div class="form-block">
184+
<div class="form-block" style="padding-top: 8px">
188185
<div class="vz-error-notice notice notice-error hidden"></div>
189186
<div class="pb-30">
190187
<div class="vz-shortcode-preview-box">
191188
<div class="vz-shortcode-preview-title border-0">
192189
<div class="icon">
193190
<img src="<?php echo esc_url( VISUALIZER_ABSURL . 'images/database-icon.png' ); ?>" alt="">
194191
</div>
195-
<div class="txt">
192+
<div class="txt" style="width: 100%;">
196193
<h4 class="h4 pb-4"><?php esc_html_e( 'Importing demo data', 'visualizer' ); ?></h4>
197-
<p class="p" data-import_message="<?php esc_attr_e( 'Done! Demo data imported successfully', 'visualizer' ); ?>"><?php esc_html_e( 'Hold on! we are importing demo data for your selected chart', 'visualizer' ); ?></p>
194+
<p class="p" data-import_message="<?php esc_attr_e( 'Done! Demo data imported successfully.', 'visualizer' ); ?>"><?php esc_html_e( 'Hold on! we are importing demo data for your selected chart', 'visualizer' ); ?></p>
195+
<div class="vz-progress" style="margin-top: 4px;">
196+
<div class="vz-progress-bar"></div>
197+
</div>
198198
</div>
199199
</div>
200200
</div>

0 commit comments

Comments
 (0)