mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-23 05:58:26 +08:00
Fix(es6-shim): References #292. Adding in es6-shim to package.json. Change the for() iterator in segment.ts changed to use a simple for loop. Short circuit functions in segment.ts incase there are no buttons, just return.
This commit is contained in:
@ -77,7 +77,12 @@ export class Segment extends Ion {
|
|||||||
* @param {string} value Value of the button to select.
|
* @param {string} value Value of the button to select.
|
||||||
*/
|
*/
|
||||||
selectFromValue(value) {
|
selectFromValue(value) {
|
||||||
for(let button of this.buttons) {
|
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];
|
||||||
if(button.value === value) {
|
if(button.value === value) {
|
||||||
button.isActive = true;
|
button.isActive = true;
|
||||||
}
|
}
|
||||||
@ -89,7 +94,9 @@ export class Segment extends Ion {
|
|||||||
* @param {SegmentButton} segmentButton The button to select.
|
* @param {SegmentButton} segmentButton The button to select.
|
||||||
*/
|
*/
|
||||||
selected(segmentButton) {
|
selected(segmentButton) {
|
||||||
for(let button of this.buttons) {
|
//for(let button of this.buttons) {
|
||||||
|
for(var i = 0, j = this.buttons.length; i < j; i++) {
|
||||||
|
let button = this.buttons[i];
|
||||||
button.isActive = false;
|
button.isActive = false;
|
||||||
}
|
}
|
||||||
segmentButton.isActive = true;
|
segmentButton.isActive = true;
|
||||||
|
@ -11,8 +11,9 @@
|
|||||||
"link": "npm install && gulp src && npm link"
|
"link": "npm install && gulp src && npm link"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"angular2": "2.0.0-alpha.42",
|
|
||||||
"@reactivex/rxjs": "0.0.0-prealpha.3",
|
"@reactivex/rxjs": "0.0.0-prealpha.3",
|
||||||
|
"angular2": "2.0.0-alpha.42",
|
||||||
|
"es6-shim": "^0.33.6",
|
||||||
"reflect-metadata": "0.1.1",
|
"reflect-metadata": "0.1.1",
|
||||||
"zone.js": "0.5.8"
|
"zone.js": "0.5.8"
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user