Fix(segment): Change for loops to be forEach

This commit is contained in:
jbavari
2015-10-16 13:19:42 -06:00
parent 28b7332e2f
commit b93aae4940

View File

@ -80,13 +80,11 @@ export class Segment extends Ion {
if (this.buttons.length == 0) {
return;
}
//for(let button of this.buttons) {
for(var i = 0, j = this.buttons.length; i < j; i++) {
var button = this.buttons[i];
this.buttons.forEach(function(button) {
if(button.value === value) {
button.isActive = true;
}
}
});
}
/**
@ -94,11 +92,9 @@ export class Segment extends Ion {
* @param {SegmentButton} segmentButton The button to select.
*/
selected(segmentButton) {
//for(let button of this.buttons) {
for(var i = 0, j = this.buttons.length; i < j; i++) {
let button = this.buttons[i];
this.buttons.forEach(function(button) {
button.isActive = false;
}
});
segmentButton.isActive = true;
//this.onChange();