Skip to content

Commit

Permalink
Merge branch 'release-3.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinark committed Jul 4, 2019
2 parents 3772dff + d46f138 commit 15a52b8
Show file tree
Hide file tree
Showing 18 changed files with 127 additions and 50 deletions.
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
Date format: d/m/y

### 3.1.0 (04/07/19)
#### Features
* Added updateStepper method (as suggested at [#78](https://github.com/Kinark/Materialize-stepper/issues/78));

#### Fixes
* Fixed autoFormCreation: false not working (fixes [#73](https://github.com/Kinark/Materialize-stepper/issues/73));

### 3.0.1 (09/03/19)
#### Fixes
* Replaced literal classes by the global constant references (fixes #67);
* Replaced literal classes by the global constant references (fixes [#67](https://github.com/Kinark/Materialize-stepper/issues/67));
* Fixed conflict with `.active` classes (fixes #65);
* Removed useless and unused `linearStepsNavigation` option;
* Code optimizations.
Expand Down
2 changes: 1 addition & 1 deletion dist/css/mstepper.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Materialize Stepper - A little plugin that implements a stepper to Materializecss framework.
* @version v3.0.1
* @version v3.1.0
* @author Igor Marcossi (Kinark) <[email protected]>.
* @link https://github.com/Kinark/Materialize-stepper
*
Expand Down
2 changes: 1 addition & 1 deletion dist/css/mstepper.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 22 additions & 8 deletions dist/js/mstepper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Materialize Stepper - A little plugin that implements a stepper to Materializecss framework.
* @version v3.0.1
* @version v3.1.0
* @author Igor Marcossi (Kinark) <[email protected]>.
* @link https://github.com/Kinark/Materialize-stepper
*
Expand Down Expand Up @@ -108,6 +108,20 @@ function () {
}
});

_defineProperty(this, "updateStepper", function () {
var getSteps = _this.getSteps,
_methodsBindingManager = _this._methodsBindingManager; // Gathers the current steps from the stepper

var _getSteps2 = getSteps(),
steps = _getSteps2.steps; // Removes any bound methods


_methodsBindingManager(steps, true); // Send the steps again to the methodsBindingManager


_methodsBindingManager(steps);
});

_defineProperty(this, "_openAction", function (step, cb) {
var closeActiveStep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var skipAutoFocus = arguments.length > 3 ? arguments[3] : undefined;
Expand Down Expand Up @@ -219,9 +233,9 @@ function () {
stepper = _this.stepper,
_openAction = _this._openAction;

var _getSteps2 = getSteps(),
steps = _getSteps2.steps,
active = _getSteps2.active;
var _getSteps3 = getSteps(),
steps = _getSteps3.steps,
active = _getSteps3.active;

var clickedStep = e.target.closest(".".concat(classes.STEP)); // Checks if the stepper is linear or not

Expand Down Expand Up @@ -254,8 +268,8 @@ function () {
var showFeedbackPreloader = options.showFeedbackPreloader,
validationFunction = options.validationFunction;

var _getSteps3 = getSteps(),
active = _getSteps3.active;
var _getSteps4 = getSteps(),
active = _getSteps4.active;

var nextStep = getSteps().steps[active.index + 1]; // Gets the feedback function (if any) from the button

Expand Down Expand Up @@ -588,12 +602,12 @@ function () {
wrapper.appendChild(stepper); // Returns the wrapper (the form)

return wrapper;
} else if (form.length) {
} else if (form && form.length) {
// The form exists
// Returns the form
return form;
} else {
// The form doesn't exist autoFormCreation is false
// The form doesn't exist and autoFormCreation is false
// Returns null
return null;
}
Expand Down
4 changes: 2 additions & 2 deletions dist/js/mstepper.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/css/mstepper.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Materialize Stepper - A little plugin that implements a stepper to Materializecss framework.
* @version v3.0.1
* @version v3.1.0
* @author Igor Marcossi (Kinark) <[email protected]>.
* @link https://github.com/Kinark/Materialize-stepper
*
Expand Down
2 changes: 1 addition & 1 deletion docs/css/mstepper.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 28 additions & 14 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ <h6>Direct download</h6>
<li>
CSS:
<ul class="browser-default">
<li><a href="https://unpkg.com/materialize-stepper@3.0.1/dist/css/mstepper.min.css">mstepper.min.css</a> minified, or</li>
<li><a href="https://unpkg.com/materialize-stepper@3.0.1/dist/css/mstepper.css">mstepper.css</a> un-minified</li>
<li><a href="https://unpkg.com/materialize-stepper@3.1.0/dist/css/mstepper.min.css">mstepper.min.css</a> minified, or</li>
<li><a href="https://unpkg.com/materialize-stepper@3.1.0/dist/css/mstepper.css">mstepper.css</a> un-minified</li>
</ul>
</li>
<li>
JavaScript:
<ul class="browser-default">
<li><a href="https://unpkg.com/materialize-stepper@3.0.1/dist/js/mstepper.min.js">mstepper.min.js</a> minified, or</li>
<li><a href="https://unpkg.com/materialize-stepper@3.0.1/dist/js/mstepper.js">mstepper.js</a> un-minified</li>
<li><a href="https://unpkg.com/materialize-stepper@3.1.0/dist/js/mstepper.min.js">mstepper.min.js</a> minified, or</li>
<li><a href="https://unpkg.com/materialize-stepper@3.1.0/dist/js/mstepper.js">mstepper.js</a> un-minified</li>
</ul>
</li>
</ul>
Expand All @@ -164,11 +164,11 @@ <h6>YARN</h6>
<h6>CDN</h6>
<pre><code class="language-html">
&lt;!-- CSS -->
&lt;link rel="stylesheet" href="https://unpkg.com/materialize-stepper@3.0.1/dist/css/mstepper.min.css">
&lt;link rel="stylesheet" href="https://unpkg.com/materialize-stepper@3.1.0/dist/css/mstepper.min.css">
</code></pre>
<pre><code class="language-html">
&lt;!-- JS -->
&lt;script src="https://unpkg.com/materialize-stepper@3.0.1/dist/js/mstepper.min.js"></script>
&lt;script src="https://unpkg.com/materialize-stepper@3.1.0/dist/js/mstepper.min.js"></script>
</code></pre>
</div>

Expand Down Expand Up @@ -750,8 +750,20 @@ <h6>Feedback function</h6>
</code></pre>
</div>

<div class="scrollspy" id="api_updatestepper">
<h6>updateStepper method</h6>
<div class="row">
<div class="col s12">
<p>If you want to the stepper to update the bindins (in case, for example, of AJAX loaded buttons), you can use updateStepper() method on the active instance.</p>
<pre><code class="language-js">
instance.updateStepper();
</code></pre>
</div>
</div>
</div>

<div class="scrollspy" id="api_resetstepper">
<h6>resetStep method</h6>
<h6>resetStepper method</h6>
<div class="row">
<div class="col xl7 l6 m12 s12">
<p>If you want to the stepper to it's original state (empty fields and options.firstActive), you can use resetStepper() method on the active instance. However, it can only be used on steppers wrapped in a form:</p>
Expand Down Expand Up @@ -1181,7 +1193,8 @@ <h6>Or you can send me some bitcoins :)</h6>
<li><a href="#api" style="pointer-events: none;"><strong>API</strong></a></li>
<li><a class="child" href="#api_navigate">Navigate</a></li>
<li><a class="child" href="#api_feedback">Feedback function</a></li>
<li><a class="child" href="#api_resetstepper">resetStep method</a></li>
<li><a class="child" href="#api_resetstepper">updateStepper method</a></li>
<li><a class="child" href="#api_resetstepper">resetStepper method</a></li>
<li><a class="child" href="#api_get_steps">Get Steps</a></li>
<li><a class="child" href="#api_wrongstep">wrongStep method</a></li>
<li><a class="child" href="#api_dyn_add_rem_steps">Dynamically add/del steps</a></li>
Expand All @@ -1201,7 +1214,7 @@ <h6>Or you can send me some bitcoins :)</h6>
</div>
</main>

<footer class="page-footer blue">
<footer class="page-footer blue" id="footer">
<div class="container">
<div class="row">
<div class="col l6 s12">
Expand Down Expand Up @@ -1233,11 +1246,12 @@ <h5 class="white-text">Links</h5>
<script src="js/prism.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function () {
var elems;
elems = document.querySelector('.toc-wrapper');
M.Pushpin.init(elems, { top: elems.offsetTop, offset: 77 });
elems = document.querySelectorAll('.scrollspy');
M.ScrollSpy.init(elems);
var sideNav = document.querySelector('.toc-wrapper');
var footer = document.querySelector('#footer');
console.log(sideNav.offsetHeight)
M.Pushpin.init(sideNav, { top: sideNav.offsetTop, offset: 77, bottom: footer.offsetTop + footer.offsetHeight - 350 });
var scrollSpy = document.querySelectorAll('.scrollspy');
M.ScrollSpy.init(scrollSpy);
});

var domSteppers = document.querySelectorAll('.stepper.demos');
Expand Down
30 changes: 22 additions & 8 deletions docs/js/mstepper.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* Materialize Stepper - A little plugin that implements a stepper to Materializecss framework.
* @version v3.0.1
* @version v3.1.0
* @author Igor Marcossi (Kinark) <[email protected]>.
* @link https://github.com/Kinark/Materialize-stepper
*
Expand Down Expand Up @@ -108,6 +108,20 @@ function () {
}
});

_defineProperty(this, "updateStepper", function () {
var getSteps = _this.getSteps,
_methodsBindingManager = _this._methodsBindingManager; // Gathers the current steps from the stepper

var _getSteps2 = getSteps(),
steps = _getSteps2.steps; // Removes any bound methods


_methodsBindingManager(steps, true); // Send the steps again to the methodsBindingManager


_methodsBindingManager(steps);
});

_defineProperty(this, "_openAction", function (step, cb) {
var closeActiveStep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var skipAutoFocus = arguments.length > 3 ? arguments[3] : undefined;
Expand Down Expand Up @@ -219,9 +233,9 @@ function () {
stepper = _this.stepper,
_openAction = _this._openAction;

var _getSteps2 = getSteps(),
steps = _getSteps2.steps,
active = _getSteps2.active;
var _getSteps3 = getSteps(),
steps = _getSteps3.steps,
active = _getSteps3.active;

var clickedStep = e.target.closest(".".concat(classes.STEP)); // Checks if the stepper is linear or not

Expand Down Expand Up @@ -254,8 +268,8 @@ function () {
var showFeedbackPreloader = options.showFeedbackPreloader,
validationFunction = options.validationFunction;

var _getSteps3 = getSteps(),
active = _getSteps3.active;
var _getSteps4 = getSteps(),
active = _getSteps4.active;

var nextStep = getSteps().steps[active.index + 1]; // Gets the feedback function (if any) from the button

Expand Down Expand Up @@ -588,12 +602,12 @@ function () {
wrapper.appendChild(stepper); // Returns the wrapper (the form)

return wrapper;
} else if (form.length) {
} else if (form && form.length) {
// The form exists
// Returns the form
return form;
} else {
// The form doesn't exist autoFormCreation is false
// The form doesn't exist and autoFormCreation is false
// Returns null
return null;
}
Expand Down
Loading

0 comments on commit 15a52b8

Please sign in to comment.