changed the buttons

This commit is contained in:
Mike Sutton 2021-10-01 13:57:08 +02:00
parent e14af79691
commit 3fcb819881

View File

@ -23,16 +23,6 @@
<% steps.each_with_index do |(key, step), index| %> <% steps.each_with_index do |(key, step), index| %>
Walter.tours["<%= tour_name %>"].addStep({ Walter.tours["<%= tour_name %>"].addStep({
when: {
show() {
const currentStepElement = shepherd.currentStep.el;
const header = currentStepElement.querySelector('.shepherd-header');
const progress = document.createElement('span');
progress.style['margin-right'] = '315px';
progress.innerText = `${shepherd.steps.indexOf(shepherd.currentStep) + 1}/${shepherd.steps.length}`;
header.insertBefore(progress, currentStepElement.querySelector('.shepherd-cancel-icon'));
}
},
id: 'step-<%= key %>', id: 'step-<%= key %>',
<% if step.key?('title') %> <% if step.key?('title') %>
title: "<%== step['title'] %>", title: "<%== step['title'] %>",
@ -46,6 +36,7 @@
}, },
<% end %> <% end %>
buttons: [ buttons: [
{ text: '<%= t('walter.exit') %>', action: Walter.tours["<%= tour_name %>"].cancel, classes: 'shepherd-button-secondary' },
<% if index == steps.size - 1 %> <% if index == steps.size - 1 %>
<% if steps.size > 1 %> <% if steps.size > 1 %>
{ text: '<%= t('walter.back') %>', action: Walter.tours["<%= tour_name %>"].back, classes: 'shepherd-button-secondary' }, { text: '<%= t('walter.back') %>', action: Walter.tours["<%= tour_name %>"].back, classes: 'shepherd-button-secondary' },
@ -55,7 +46,6 @@
<% if index == 0 %> <% if index == 0 %>
{ text: '<%= t('walter.later') %>', action: Walter.tours["<%= tour_name %>"].cancel, classes: 'shepherd-button-secondary' }, { text: '<%= t('walter.later') %>', action: Walter.tours["<%= tour_name %>"].cancel, classes: 'shepherd-button-secondary' },
<% else %> <% else %>
{ text: '<%= t('walter.exit') %>', action: Walter.tours["<%= tour_name %>"].cancel, classes: 'shepherd-button-secondary' },
{ text: '<%= t('walter.back') %>', action: Walter.tours["<%= tour_name %>"].back, classes: 'shepherd-button-secondary' }, { text: '<%= t('walter.back') %>', action: Walter.tours["<%= tour_name %>"].back, classes: 'shepherd-button-secondary' },
<% end %> <% end %>
{ text: '<%= t('walter.continue') %>', action: Walter.tours["<%= tour_name %>"].next }, { text: '<%= t('walter.continue') %>', action: Walter.tours["<%= tour_name %>"].next },