Commit f150ba3a authored by Téo Vasseur's avatar Téo Vasseur
Browse files

segmenter.js, generic_axis.js : corrections for jshint

$ jshint browser/js/*.js

browser/js/generic_axis.js: line 102, col 29, 'pos' is already defined.

browser/js/segmenter.js: line 165, col 34, Don't make functions within a loop.
browser/js/segmenter.js: line 264, col 17, 'i' is already defined.
browser/js/segmenter.js: line 282, col 21, 'input' is already defined.
browser/js/segmenter.js: line 297, col 21, 'label' is already defined.
parent 0f43bc84
Pipeline #2083 failed with stages
in 28 seconds
......@@ -87,19 +87,20 @@ GenericAxis.prototype = {
if (typeof labels === 'undefined')
this.computeLabels(values);
else {
var pos;
for (var i=0; i < values.length; i++) {
var value = values[i];
var convert = this.applyConverter(value);
if (labels.indexOf(convert) != -1) {
if (typeof label_mapping[convert] === 'undefined') {
var pos = labels.indexOf(convert)/labels.length;
pos = labels.indexOf(convert)/labels.length;
if (this.reverse)
pas = 1 - pos;
this.addLabel("line", convert, pos, convert);
}
} else {
if (this.can_undefined) {
var pos = 1;
pos = 1;
if (this.reverse)
pos = 0;
this.addLabel("line", "?", pos, "?");
......
......@@ -157,21 +157,19 @@ Segment.prototype = {
var available_axis = (new Axes(this.m)).available();
for (var i in axOpts) {
var axis_option = document.createElement('div');
var input = document.createElement('input');
input.setAttribute('type', "checkbox");
input.setAttribute('value', axOpts[i]);
input.setAttribute('id', "sai"+i); // segmenter axis input
if (axOpts[i] == "Size") input.setAttribute('checked', "");
input.onchange = function() {
self.update();
};
var label = document.createElement('label');
label.setAttribute('for', "sai"+i);
label.appendChild(document.createTextNode(available_axis[axOpts[i]].label));
axis_option.appendChild(input);
axis_option.appendChild(label);
var axis_input = document.createElement('input');
axis_input.setAttribute('type', "checkbox");
axis_input.setAttribute('value', axOpts[i]);
axis_input.setAttribute('id', "sai"+i); // segmenter axis input
if (axOpts[i] == "Size") axis_input.setAttribute('checked', "");
axis_input.onchange = self.update();
var axis_label = document.createElement('label');
axis_label.setAttribute('for', "sai"+i);
axis_label.appendChild(document.createTextNode(available_axis[axOpts[i]].label));
axis_option.appendChild(axis_input);
axis_option.appendChild(axis_label);
tmp.appendChild(axis_option);
}
......@@ -261,12 +259,12 @@ Segment.prototype = {
span_fixsegmenter = document.createElement('span')
span_fixsegmenter.id = "fixsegmenter"
span_fixsegmenter.className = "button"
var i = document.createElement('i');
i.setAttribute("title", 'fix the segmenter in his position');
i.onclick = function() {
var i_elem = document.createElement('i');
i_elem.setAttribute("title", 'fix the segmenter in his position');
i_elem.onclick = function() {
self.switchFixed();
}
span_fixsegmenter.appendChild(i);
span_fixsegmenter.appendChild(i_elem);
div.appendChild(div_menu);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment