mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
allow js positioning to be removed
This commit is contained in:
parent
44197cb852
commit
2bd70c3805
@ -322,6 +322,7 @@ jQuery(function ($) {
|
|||||||
|
|
||||||
this.$el = element instanceof jQuery ? element : $(element);
|
this.$el = element instanceof jQuery ? element : $(element);
|
||||||
this.$buttons = this.$el.find('.step-button-jump');
|
this.$buttons = this.$el.find('.step-button-jump');
|
||||||
|
this.$jsAlign = this.$el.find('.js-align');
|
||||||
|
|
||||||
// Update the progress bar when 'step' buttons are clicked.
|
// Update the progress bar when 'step' buttons are clicked.
|
||||||
this.$buttons.each(function (i, stepButton) {
|
this.$buttons.each(function (i, stepButton) {
|
||||||
@ -337,9 +338,9 @@ jQuery(function ($) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Spaces out the steps below progress bar evenly
|
// Spaces out the steps below progress bar evenly
|
||||||
this.$buttons.each(function (index, button) {
|
this.$jsAlign.each(function (index, button) {
|
||||||
var $button = $(button),
|
var $button = $(button),
|
||||||
leftPercent = (100 / (self.$buttons.length - 1) * index + '%'),
|
leftPercent = (100 / (self.$jsAlign.length - 1) * index + '%'),
|
||||||
buttonOffset = -1 * ($button.innerWidth() / 2);
|
buttonOffset = -1 * ($button.innerWidth() / 2);
|
||||||
|
|
||||||
$button.css({left: leftPercent, marginLeft: buttonOffset});
|
$button.css({left: leftPercent, marginLeft: buttonOffset});
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<ul class="step-buttons">
|
<ul class="step-buttons">
|
||||||
<% loop $NumberOfSteps %>
|
<% loop $NumberOfSteps %>
|
||||||
<li class="step-button-wrapper<% if $Pos == '1' %> current<% end_if %>">
|
<li class="step-button-wrapper<% if $Pos == '1' %> current<% end_if %>">
|
||||||
<button class="step-button-jump" disabled="disabled">$Pos</button>
|
<button class="step-button-jump js-align" disabled="disabled">$Pos</button><!-- Remove js-align class to remove javascript positioning -->
|
||||||
</li>
|
</li>
|
||||||
<% end_loop %>
|
<% end_loop %>
|
||||||
<ul>
|
<ul>
|
||||||
|
Loading…
Reference in New Issue
Block a user