Fix isRTL option passed to ShuffleItem class

pull/337/head
Amir hossein Karimi 3 years ago
parent 4a50a803c5
commit 6758e12d32
No known key found for this signature in database
GPG Key ID: B25445C4146B0C1F

@ -337,7 +337,7 @@ class Shuffle extends TinyEmitter {
_getItems() { _getItems() {
return Array.from(this.element.children) return Array.from(this.element.children)
.filter((el) => matches(el, this.options.itemSelector)) .filter((el) => matches(el, this.options.itemSelector))
.map((el) => new ShuffleItem(el, this.options)); .map((el) => new ShuffleItem(el, this.options.isRTL));
} }
/** /**
@ -862,7 +862,7 @@ class Shuffle extends TinyEmitter {
* @param {Element[]} newItems Collection of new items. * @param {Element[]} newItems Collection of new items.
*/ */
add(newItems) { add(newItems) {
const items = arrayUnique(newItems).map((el) => new ShuffleItem(el, this.options)); const items = arrayUnique(newItems).map((el) => new ShuffleItem(el, this.options.isRTL));
// Add classes and set initial positions. // Add classes and set initial positions.
this._initItems(items); this._initItems(items);

Loading…
Cancel
Save