var scroll_to_popup = function(step) {
main_tour.going_somewhere = false;
step = main_tour.getCurrentStep();
var target = $(step.tether.target);
$('body, html').animate({
scrollTop: popup.offset().top - 50
window.scrollTo(0, popup.offset().top - 50);
// If $('#updraft-backupnow-button'), start tour
if ($('#updraft-backupnow-button').length) {
$('#updraft-backupnow-button').on('click', function(e) {
if (!main_tour.canceled) {
main_tour.show('backup_options');
$('#updraft-navtab-backups').on('click', function(e) {
if (!main_tour.canceled) {
main_tour.show('backup_now');
$(document).on('click', 'label[for=updraft_servicecheckbox_updraftvault]', function(e) {
if (!main_tour.canceled && !$('#updraft_servicecheckbox_updraftvault').is(':checked')) {
main_tour.show('vault_selected');
// close backup backupnow modal
$('#updraft-backupnow-modal').on("dialogclose", function(event, ui) {
if (!main_tour.canceled) {
main_tour.show('backup_now');
// Backup now - manual backup is starting
$('.js-tour-backup-now-button').on('click', function(e) {
if (!main_tour.canceled) {
main_tour.show('backup_now_btn_success');
$('#updraft-navtab-settings').on('click', function(e) {
if (!main_tour.canceled && !main_tour.going_somewhere) {
main_tour.show('settings_timing');
$('#updraft-navtab-addons').on('click', function(e) {
if (!main_tour.canceled) {
main_tour.show('premium');
$('#updraft-navtab-migrate, #updraft-navtab-expert').on('click', function(e) {
if (!main_tour.canceled) {
if (updraftplus_tour_i18n.show_tab_on_load) {
$(updraftplus_tour_i18n.show_tab_on_load).trigger('click');
$('#updraft-navtab-backups').trigger('click');
// start plugins page tour
if ($('.js-updraftplus-settings').length) {
plugins_page_tour.start();