mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 14:01:20 +08:00
fix(slides): negative number indicates position starting at end (#10997)
* fix(slides): negative number indicates position starting at end * refactor(slides): use var instead of let
This commit is contained in:
@ -63,8 +63,9 @@ export function updatePaginationClasses(s: Slides) {
|
|||||||
|
|
||||||
// Types
|
// Types
|
||||||
if (s.paginationType === 'bullets' && s._bullets) {
|
if (s.paginationType === 'bullets' && s._bullets) {
|
||||||
|
var selector = current + ( current < 0 ? s._bullets.length : 0 );
|
||||||
for (var i = 0; i < s._bullets.length; i++) {
|
for (var i = 0; i < s._bullets.length; i++) {
|
||||||
if (i === current) {
|
if (i === selector) {
|
||||||
addClass(s._bullets[i], CLS.bulletActive);
|
addClass(s._bullets[i], CLS.bulletActive);
|
||||||
} else {
|
} else {
|
||||||
removeClass(s._bullets[i], CLS.bulletActive);
|
removeClass(s._bullets[i], CLS.bulletActive);
|
||||||
|
Reference in New Issue
Block a user