PDA

View Full Version : [CLOSED] Carousel indicator fails counting items



alex.k
26 Nov 2011, 11:06 AM
REQUIRED INFORMATION


Ext version tested:

Touch 2.0-pr1

Browser versions tested against:

Chrome
FF3 (firebug 1.3.0.10 installed
Description:

Removing an item from carsousel is adding an indicator, instead of removing one.

Steps to reproduce the problem:

Run the code below

The result that was expected:

Proper indicator count decreased

The result that occurs instead:

Improper indicator count increased
Test Case:



Ext.application({
name: 'Sencha',


launch: function() {
var c = Ext.create("Ext.carousel.Carousel", {
fullscreen: true,
items: [{
title: 'Home',
iconCls: 'home',
html: 'Welcome'
}, {
title: 'Home',
iconCls: 'home',
html: 'Sweet Welcome'
}]
});
console.log(c.getItems().getCount()); // = 3, correct, 2 panels + indicator
console.log(c.getIndicator().indicators.length); // =2, correct, 2 visible panels
c.removeAt(0);
console.log(c.getItems().getCount()); // = 2, correct, 1 panel + indicator
console.log(c.getIndicator().indicators.length); // =3, wrong, i.e. indicator added instead of removed
//NB: the problem is Carousel.js#216, inside onRemove : function...
// line 216 reads : indicator.addIndicator();
// should be: indicator.removeIndicator();
// copy-pasted code from onAdd ??
}
});






HELPFUL INFORMATION

Debugging already done:

yes

Possible fix:

fix Carousel.js #216: replace indicator.addIndicator() => indicator.removeIndicator()
fyi, this is inside onRemove : function()...

Operating System:

WinXP Pro

Jamie Avins
28 Nov 2011, 10:03 AM
This was resolved in PR2.