diff --git a/assets/css/app.css b/assets/css/app.css index 9ecc0e7..663ffd7 100644 --- a/assets/css/app.css +++ b/assets/css/app.css @@ -16,6 +16,7 @@ body { background: var(--bg-color); & > div { h2 { + margin: 3rem auto; font-size: 2.3rem; color: var(--secondary); text-align: center; diff --git a/assets/js/app.js b/assets/js/app.js index 3b86166..21f2664 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -95,6 +95,8 @@ window.stepper = { submit() { axios.post('/wp-admin/admin-ajax.php?action=stepper_submit', { ...this.value + }).then(ret => { + this.step++; }); } }; diff --git a/src/Stepper.php b/src/Stepper.php index 555d63c..385148a 100644 --- a/src/Stepper.php +++ b/src/Stepper.php @@ -27,6 +27,7 @@ class Stepper { public function init() { add_action('wp_enqueue_scripts', [ $this, 'enqueue' ]); add_action('wp_ajax_nopriv_stepper_submit', [ $this, 'onSubmit' ]); + add_action('wp_ajax_stepper_submit', [ $this, 'onSubmit' ]); add_shortcode('stepper', [ $this, 'handle' ]); } diff --git a/views/stepper.twig.htm b/views/stepper.twig.htm index fd39f93..2210439 100644 --- a/views/stepper.twig.htm +++ b/views/stepper.twig.htm @@ -15,6 +15,7 @@ +