@@ -109,36 +109,36 @@ Features.prototype.generateElements = function (featuresElements) {
109
109
110
110
const listElements = [ ] ;
111
111
112
- for ( let i = 0 ; i < self . _features . length ; i ++ ) {
112
+ for ( const feature of self . _features ) {
113
113
let feature_tip_html = '' ;
114
- const rawFeatureName = self . _features [ i ] . name ;
115
- const featureBit = self . _features [ i ] . bit ;
114
+ const rawFeatureName = feature . name ;
115
+ const featureBit = feature . bit ;
116
116
117
- if ( self . _features [ i ] . haveTip ) {
117
+ if ( feature . haveTip ) {
118
118
feature_tip_html = `<div class="helpicon cf_tip" i18n_title="feature${ rawFeatureName } Tip"></div>` ;
119
119
}
120
120
121
121
const newElements = [ ] ;
122
122
123
- if ( self . _features [ i ] . mode === 'select' ) {
123
+ if ( feature . mode === 'select' ) {
124
124
if ( listElements . length === 0 ) {
125
125
newElements . push ( $ ( '<option class="feature" value="-1" i18n="featureNone" />' ) ) ;
126
126
}
127
- const newElement = $ ( `<option class="feature" id="feature${ featureBit - 1 } " name="${ rawFeatureName } " value="${ featureBit } " i18n="feature${ rawFeatureName } " />` ) ;
127
+ const newElement = $ ( `<option class="feature" id="feature${ featureBit } " name="${ rawFeatureName } " value="${ featureBit } " i18n="feature${ rawFeatureName } " />` ) ;
128
128
129
129
newElements . push ( newElement ) ;
130
130
listElements . push ( newElement ) ;
131
131
} else {
132
132
let featureName = '' ;
133
- if ( ! self . _features [ i ] . hideName ) {
133
+ if ( ! feature . hideName ) {
134
134
featureName = `<td><div>${ rawFeatureName } </div></td>` ;
135
135
}
136
136
137
- let element = `<tr><td><input class="feature toggle" id="feature${ featureBit - 1 } "` ;
138
- element += `name="${ self . _features [ i ] . name } " title="${ self . _features [ i ] . name } "` ;
137
+ let element = `<tr><td><input class="feature toggle" id="feature${ featureBit } "` ;
138
+ element += `name="${ feature . name } " title="${ rawFeatureName } "` ;
139
139
element += `type="checkbox"/></td><td><div>${ featureName } </div>` ;
140
- element += `<span class="xs" i18n="feature${ self . _features [ i ] . name } "></span></td>` ;
141
- element += `<td><span class="sm-min" i18n="feature${ self . _features [ i ] . name } "></span>` ;
140
+ element += `<span class="xs" i18n="feature${ rawFeatureName } "></span></td>` ;
141
+ element += `<td><span class="sm-min" i18n="feature${ rawFeatureName } "></span>` ;
142
142
element += `${ feature_tip_html } </td></tr>` ;
143
143
144
144
const newElement = $ ( element ) ;
@@ -152,7 +152,7 @@ Features.prototype.generateElements = function (featuresElements) {
152
152
}
153
153
154
154
featuresElements . each ( function ( ) {
155
- if ( $ ( this ) . hasClass ( self . _features [ i ] . group ) ) {
155
+ if ( $ ( this ) . hasClass ( feature . group ) ) {
156
156
$ ( this ) . append ( newElements ) ;
157
157
}
158
158
} ) ;
0 commit comments