|
@@ -2553,7 +2553,6 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
}
|
|
|
|
|
|
function destroy() {
|
|
|
- removeAttribute(list, ALL_ATTRIBUTES);
|
|
|
events.forEach(function (event) {
|
|
|
event.destroy();
|
|
|
});
|
|
@@ -2653,9 +2652,10 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
|
|
|
var list = Components2.Elements.list;
|
|
|
var live = options.live;
|
|
|
+ var enabled = live && !options.isNavigation;
|
|
|
|
|
|
function mount() {
|
|
|
- if (live) {
|
|
|
+ if (enabled) {
|
|
|
setAttribute(list, ARIA_ATOMIC, false);
|
|
|
disable(!Components2.Autoplay.isPaused());
|
|
|
on(EVENT_AUTOPLAY_PLAY, apply(disable, true));
|
|
@@ -2664,7 +2664,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
}
|
|
|
|
|
|
function disable(disabled) {
|
|
|
- if (live) {
|
|
|
+ if (enabled) {
|
|
|
setAttribute(list, ARIA_LIVE, disabled ? "off" : "polite");
|
|
|
}
|
|
|
}
|
|
@@ -2730,6 +2730,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
slideFocus: true,
|
|
|
trimSpace: true,
|
|
|
focusableNodes: "a, button, textarea, input, select, iframe",
|
|
|
+ live: true,
|
|
|
classes: CLASSES,
|
|
|
i18n: I18N
|
|
|
};
|
|
@@ -2831,8 +2832,8 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
this.Components = {};
|
|
|
this.state = State(CREATED);
|
|
|
this.splides = [];
|
|
|
- this._o = {};
|
|
|
- this._E = {};
|
|
|
+ this._options = {};
|
|
|
+ this._Extensions = {};
|
|
|
var root = isString(target) ? query(document, target) : target;
|
|
|
assert(root, root + " is invalid.");
|
|
|
this.root = root;
|
|
@@ -2844,7 +2845,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
assert(false, "Invalid JSON");
|
|
|
}
|
|
|
|
|
|
- this._o = options;
|
|
|
+ this._options = options;
|
|
|
}
|
|
|
|
|
|
var _proto = _Splide.prototype;
|
|
@@ -2856,14 +2857,14 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
Components2 = this.Components;
|
|
|
assert(state.is([CREATED, DESTROYED]), "Already mounted!");
|
|
|
state.set(CREATED);
|
|
|
- this._C = Components2;
|
|
|
- this._T = Transition || this._T || (this.is(FADE) ? Fade : Slide);
|
|
|
- this._E = Extensions || this._E;
|
|
|
- var Constructors = assign({}, ComponentConstructors, this._E, {
|
|
|
- Transition: this._T
|
|
|
+ this._Components = Components2;
|
|
|
+ this._Transition = Transition || this._Transition || (this.is(FADE) ? Fade : Slide);
|
|
|
+ this._Extensions = Extensions || this._Extensions;
|
|
|
+ var Constructors = assign({}, ComponentConstructors, this._Extensions, {
|
|
|
+ Transition: this._Transition
|
|
|
});
|
|
|
forOwn(Constructors, function (Component, key) {
|
|
|
- var component = Component(_this2, Components2, _this2._o);
|
|
|
+ var component = Component(_this2, Components2, _this2._options);
|
|
|
Components2[key] = component;
|
|
|
component.setup && component.setup();
|
|
|
});
|
|
@@ -2887,7 +2888,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
});
|
|
|
|
|
|
if (this.state.is(IDLE)) {
|
|
|
- this._C.Sync.remount();
|
|
|
+ this._Components.Sync.remount();
|
|
|
|
|
|
splide.Components.Sync.remount();
|
|
|
}
|
|
@@ -2896,7 +2897,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
};
|
|
|
|
|
|
_proto.go = function go(control) {
|
|
|
- this._C.Controller.go(control);
|
|
|
+ this._Components.Controller.go(control);
|
|
|
|
|
|
return this;
|
|
|
};
|
|
@@ -2920,19 +2921,19 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
};
|
|
|
|
|
|
_proto.add = function add(slides, index) {
|
|
|
- this._C.Slides.add(slides, index);
|
|
|
+ this._Components.Slides.add(slides, index);
|
|
|
|
|
|
return this;
|
|
|
};
|
|
|
|
|
|
_proto.remove = function remove(matcher) {
|
|
|
- this._C.Slides.remove(matcher);
|
|
|
+ this._Components.Slides.remove(matcher);
|
|
|
|
|
|
return this;
|
|
|
};
|
|
|
|
|
|
_proto.is = function is(type) {
|
|
|
- return this._o.type === type;
|
|
|
+ return this._options.type === type;
|
|
|
};
|
|
|
|
|
|
_proto.refresh = function refresh() {
|
|
@@ -2951,7 +2952,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
if (state.is(CREATED)) {
|
|
|
EventInterface(this).on(EVENT_READY, this.destroy.bind(this, completely));
|
|
|
} else {
|
|
|
- forOwn(this._C, function (component) {
|
|
|
+ forOwn(this._Components, function (component) {
|
|
|
component.destroy && component.destroy(completely);
|
|
|
}, true);
|
|
|
event.emit(EVENT_DESTROY);
|
|
@@ -2966,25 +2967,25 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
_createClass(_Splide, [{
|
|
|
key: "options",
|
|
|
get: function get() {
|
|
|
- return this._o;
|
|
|
+ return this._options;
|
|
|
},
|
|
|
set: function set(options) {
|
|
|
- var _o = this._o;
|
|
|
- merge(_o, options);
|
|
|
+ var _options = this._options;
|
|
|
+ merge(_options, options);
|
|
|
|
|
|
if (!this.state.is(CREATED)) {
|
|
|
- this.emit(EVENT_UPDATED, _o);
|
|
|
+ this.emit(EVENT_UPDATED, _options);
|
|
|
}
|
|
|
}
|
|
|
}, {
|
|
|
key: "length",
|
|
|
get: function get() {
|
|
|
- return this._C.Slides.getLength(true);
|
|
|
+ return this._Components.Slides.getLength(true);
|
|
|
}
|
|
|
}, {
|
|
|
key: "index",
|
|
|
get: function get() {
|
|
|
- return this._C.Controller.getIndex();
|
|
|
+ return this._Components.Controller.getIndex();
|
|
|
}
|
|
|
}]);
|
|
|
|