function trackCurrentPage($activeCard) {
          if (!options.track) {
            return;
          }

          var page = (options.track === 'index')
            ? ($allCards.index($activeCard) + 1)
            : $activeCard.data('webform-key');

          // Set form data attribute.
          $form.data('webform-wizard-current-page', page);

          // Set URL
          var url = window.location.toString();
          var regex = /([?&])page=[^?&]+/;
          if (url.match(regex)) {
            url = url.replace(regex, '$1page=' + page);
          }
          else {
            url = url + (url.indexOf('?') !== -1 ? '&page=' : '?page=') + page;
          }
          window.history.replaceState(null, null, url);
        }
/**
         * Track the current page in a form data attribute and the URL.
         *
         * @param {jQuery} $activeCard
         *   An jQuery object containing the active card.
         *
         * @see \Drupal\webform\WebformSubmissionForm::form
         * @see Drupal.behaviors.webformWizardTrackPage
         */
Track the current page in a form data attribute and the URL.
@param {jQuery} $activeCard
An jQuery object containing the active card.


Track the current page in a form data attribute and the URL . @param { jQuery } $activeCard An jQuery object containing the active card .
function trackCurrentPage($activeCard) {
          if (!options.track) {
            return;
          }
          var page = (options.track === 'index')
            ? ($allCards.index($activeCard) + 1)
            : $activeCard.data('webform-key');
          $form.data('webform-wizard-current-page', page);
          var url = window.location.toString();
          var regex = /([?&])page=[^?&]+/;
          if (url.match(regex)) {
            url = url.replace(regex, '$1page=' + page);
          }
          else {
            url = url + (url.indexOf('?') !== -1 ? '&page=' : '?page=') + page;
          }
          window.history.replaceState(null, null, url);
        }
function trackCurrentPage ( $activeCard ) { if ( ! options . track ) { return ; } var page = ( options . track === 'index' ) ? ( $allCards . index ( $activeCard ) + 1 ) : $activeCard . data ( 'webform-key' ) ; $form . data ( 'webform-wizard-current-page' , page ) ; var url = window . location . toString ( ) ; var regex = / ([?&])page=[^?&]+ / ; if ( url . match ( regex ) ) { url = url . replace ( regex , '$1page=' + page ) ; } else { url = url + ( url . indexOf ( '?' ) !== - 1 ? '&page=' : '?page=' ) + page ; } window . history . replaceState ( null , null , url ) ; }
Track the current page in a form data attribute and the URL.
Track the current page in a form data attribute and the URL .
// Set form data attribute. // Set URL