diff --git a/widget/Rotator.js b/widget/Rotator.js index b1ee97f231..e9b3dd50b4 100644 --- a/widget/Rotator.js +++ b/widget/Rotator.js @@ -185,6 +185,9 @@ define([ } _t._domNode.removeChild(removed.node); } + if (_t.idx > idx) { + _t.idx--; + } } var index, @@ -196,7 +199,7 @@ define([ } else { for (var i = 0; i < panes.length; i++) { - if (panes.node === nodeOrIndex) { + if (panes[i].node === nodeOrIndex) { index = i; break; } @@ -220,9 +223,6 @@ define([ } else { removeFromPanes(index); - if (this.idx > index) { - this.idx--; - } } }, diff --git a/widget/tests/test_Rotator.html b/widget/tests/test_Rotator.html index a4c90284ca..c778a2f322 100644 --- a/widget/tests/test_Rotator.html +++ b/widget/tests/test_Rotator.html @@ -858,8 +858,17 @@