makeup-navigation-emitter
Advanced tools
Comparing version 0.2.2 to 0.2.3
23
index.js
@@ -84,10 +84,3 @@ 'use strict'; // requires following polyfills or transforms for IE11 | ||
if (this.options.autoReset !== null) { | ||
this._index = this.options.autoReset; // do not use index setter, it will trigger change event | ||
this._el.dispatchEvent(new CustomEvent('navigationModelReset', { | ||
detail: { | ||
toIndex: this.options.autoReset | ||
}, | ||
bubbles: false | ||
})); | ||
this.reset(); | ||
} | ||
@@ -139,2 +132,16 @@ } | ||
_createClass(LinearNavigationModel, [{ | ||
key: "reset", | ||
value: function reset() { | ||
if (this.options.autoReset !== null) { | ||
this._index = this.options.autoReset; // do not use index setter, it will trigger change event | ||
this._el.dispatchEvent(new CustomEvent('navigationModelReset', { | ||
detail: { | ||
toIndex: this.options.autoReset | ||
}, | ||
bubbles: false | ||
})); | ||
} | ||
} | ||
}, { | ||
key: "atEnd", | ||
@@ -141,0 +148,0 @@ value: function atEnd() { |
{ | ||
"name": "makeup-navigation-emitter", | ||
"description": "Emits custom events based on keyboard navigation of one or two dimensional model", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "repository": "https://github.com/makeup-js/makeup-navigation-emitter.git", |
@@ -121,2 +121,7 @@ # makeup-navigation-emitter | ||
## Methods | ||
* `destroy`: destroys all event listeners | ||
* `reset`: will force a reset to the value specified by `autoReset` | ||
## Events | ||
@@ -123,0 +128,0 @@ |
278530
222
172