Skip to content

Commit cc58529

Browse files
authored
Merge pull request #402 from mikeller/reorder_mixer_list
Reordered mixer list for better useability.
2 parents 595f2ce + 63254dc commit cc58529

File tree

2 files changed

+33
-30
lines changed

2 files changed

+33
-30
lines changed

js/model.js

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,34 @@
22

33
// generate mixer
44
var mixerList = [
5-
{name: 'Tricopter', model: 'tricopter', image: 'tri'},
6-
{name: 'Quad +', model: 'quad_x', image: 'quad_p'},
7-
{name: 'Quad X', model: 'quad_x', image: 'quad_x'},
8-
{name: 'Bicopter', model: 'custom', image: 'bicopter'},
9-
{name: 'Gimbal', model: 'custom', image: 'custom'},
10-
{name: 'Y6', model: 'y6', image: 'y6'},
11-
{name: 'Hex +', model: 'hex_plus', image: 'hex_p'},
12-
{name: 'Flying Wing', model: 'custom', image: 'flying_wing'},
13-
{name: 'Y4', model: 'y4', image: 'y4'},
14-
{name: 'Hex X', model: 'hex_x', image: 'hex_x'},
15-
{name: 'Octo X8', model: 'custom', image: 'octo_x8'},
16-
{name: 'Octo Flat +', model: 'custom', image: 'octo_flat_p'},
17-
{name: 'Octo Flat X', model: 'custom', image: 'octo_flat_x'},
18-
{name: 'Airplane', model: 'custom', image: 'airplane'},
19-
{name: 'Heli 120', model: 'custom', image: 'custom'},
20-
{name: 'Heli 90', model: 'custom', image: 'custom'},
21-
{name: 'V-tail Quad', model: 'quad_vtail', image: 'vtail_quad'},
22-
{name: 'Hex H', model: 'custom', image: 'custom'},
23-
{name: 'PPM to SERVO', model: 'custom', image: 'custom'},
24-
{name: 'Dualcopter', model: 'custom', image: 'custom'},
25-
{name: 'Singlecopter', model: 'custom', image: 'custom'},
26-
{name: 'A-tail Quad', model: 'quad_atail', image: 'atail_quad'},
27-
{name: 'Custom', model: 'custom', image: 'custom'},
28-
{name: 'Custom Airplane', model: 'custom', image: 'custom'},
29-
{name: 'Custom Tricopter', model: 'custom', image: 'custom'},
30-
{name: 'Quad X 1234', model: 'quad_x', image: 'quad_x_1234'}
5+
{name: 'Tricopter', pos: 3, model: 'tricopter', image: 'tri'},
6+
{name: 'Quad +', pos: 2, model: 'quad_x', image: 'quad_p'},
7+
{name: 'Quad X', pos: 0, model: 'quad_x', image: 'quad_x'},
8+
{name: 'Bicopter', pos: 16, model: 'custom', image: 'bicopter'},
9+
{name: 'Gimbal', pos: 4, model: 'custom', image: 'custom'},
10+
{name: 'Y6', pos: 20, model: 'y6', image: 'y6'},
11+
{name: 'Hex +', pos: 5, model: 'hex_plus', image: 'hex_p'},
12+
{name: 'Flying Wing', pos: 10, model: 'custom', image: 'flying_wing'},
13+
{name: 'Y4', pos: 19, model: 'y4', image: 'y4'},
14+
{name: 'Hex X', pos: 6, model: 'hex_x', image: 'hex_x'},
15+
{name: 'Octo X8', pos: 21, model: 'custom', image: 'octo_x8'},
16+
{name: 'Octo Flat +', pos: 8, model: 'custom', image: 'octo_flat_p'},
17+
{name: 'Octo Flat X', pos: 9, model: 'custom', image: 'octo_flat_x'},
18+
{name: 'Airplane', pos: 11, model: 'custom', image: 'airplane'},
19+
{name: 'Heli 120', pos: 12, model: 'custom', image: 'custom'},
20+
{name: 'Heli 90', pos: 13, model: 'custom', image: 'custom'},
21+
{name: 'V-tail Quad', pos: 17, model: 'quad_vtail', image: 'vtail_quad'},
22+
{name: 'Hex H', pos: 7, model: 'custom', image: 'custom'},
23+
{name: 'PPM to SERVO', pos: 22, model: 'custom', image: 'custom'},
24+
{name: 'Dualcopter', pos: 15, model: 'custom', image: 'custom'},
25+
{name: 'Singlecopter', pos: 14, model: 'custom', image: 'custom'},
26+
{name: 'A-tail Quad', pos: 18, model: 'quad_atail', image: 'atail_quad'},
27+
{name: 'Custom', pos: 23, model: 'custom', image: 'custom'},
28+
{name: 'Custom Airplane', pos: 24, model: 'custom', image: 'custom'},
29+
{name: 'Custom Tricopter', pos: 25, model: 'custom', image: 'custom'},
30+
{name: 'Quad X 1234', pos: 1, model: 'quad_x', image: 'quad_x_1234'}
3131
];
3232

33-
3433
// 3D model
3534
var Model = function (wrapper, canvas) {
3635
var useWebGLRenderer = this.canUseWebGLRenderer();
@@ -106,7 +105,7 @@ Model.prototype.canUseWebGLRenderer = function () {
106105
// and webgl will be supported if gpu supports it by default (canary 40.0.2175.0), keep an eye on this one
107106
var detector_canvas = document.createElement('canvas');
108107

109-
return window.WebGLRenderingContext && (detector_canvas.getContext('webgl') || detector_canvas.getContext('experimental-webgl'))
108+
return window.WebGLRenderingContext && (detector_canvas.getContext('webgl') || detector_canvas.getContext('experimental-webgl'));
110109
};
111110

112111
Model.prototype.rotateTo = function (x, y, z) {

tabs/configuration.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,12 @@ TABS.configuration.initialize = function (callback, scrollPosition) {
143143

144144
function process_html() {
145145
var mixer_list_e = $('select.mixerList');
146-
for (var i = 0; i < mixerList.length; i++) {
147-
mixer_list_e.append('<option value="' + (i + 1) + '">' + mixerList[i].name + '</option>');
146+
for (var selectIndex = 0; selectIndex < mixerList.length; selectIndex++) {
147+
mixerList.forEach(function (mixerEntry, mixerIndex) {
148+
if (mixerEntry.pos === selectIndex) {
149+
mixer_list_e.append('<option value="' + (mixerIndex + 1) + '">' + mixerEntry.name + '</option>');
150+
}
151+
});
148152
}
149153

150154
mixer_list_e.change(function () {

0 commit comments

Comments
 (0)