docs: function afterAnimation() {
        var pageClasses = 'page-previous page-current page-next';
        var navbarClasses = 'navbar-previous navbar-current navbar-next';
        $newPage.removeClass(pageClasses).addClass('page-current').removeAttr('aria-hidden').trigger('page:position', { position: 'current' });
        $oldPage.removeClass(pageClasses).addClass('page-previous').trigger('page:position', { position: 'previous' });
        if (!$oldPage.hasClass('page-master')) {
          $oldPage.attr('aria-hidden', 'true');
        }
        if (dynamicNavbar) {
          $newNavbarInner.removeClass(navbarClasses).addClass('navbar-current').removeAttr('aria-hidden');
          $oldNavbarInner.removeClass(navbarClasses).addClass('navbar-previous');
          if (!$oldNavbarInner.hasClass('navbar-master')) {
            $oldNavbarInner.attr('aria-hidden', 'true');
          }
        }
        // After animation event
        router.allowPageChange = true;
        router.pageCallback('afterIn', $newPage, $newNavbarInner, 'next', 'current', options);
        router.pageCallback('afterOut', $oldPage, $oldNavbarInner, 'current', 'previous', options);
  
        var keepOldPage = (router.params.preloadPreviousPage || router.params[((app.theme) + "SwipeBack")]) && !isMaster;
        if (!keepOldPage) {
          if ($newPage.hasClass('smart-select-page') || $newPage.hasClass('photo-browser-page') || $newPage.hasClass('autocomplete-page')) {
            keepOldPage = true;
          }
        }
        if (!keepOldPage) {
          if (router.params.stackPages) {
            $oldPage.addClass('stacked');
            $oldPage.trigger('page:stack');
            if (separateNavbar) {
              $oldNavbarInner.addClass('stacked');
            }
          } else if (!($newPage.attr('data-name') && $newPage.attr('data-name') === 'smart-select-page')) {
            // Remove event
            router.pageCallback('beforeRemove', $oldPage, $oldNavbarInner, 'previous', undefined, options);
            router.removePage($oldPage);
            if (separateNavbar && $oldNavbarInner.length) {
              router.removeNavbar($oldNavbarInner);
            }
          }
        }
        if (options.clearPreviousHistory) { router.clearPreviousHistory(); }
        router.emit('routeChanged', router.currentRoute, router.previousRoute, router);
  
        if (router.params.pushState) {
          History.clearRouterQueue();
        }
      }