Commit 4cbd38c5 authored by flothoni's avatar flothoni

model; semgenter & clone.js; use model available_axes variable

Don't create Axes object and call available function each time.
Reuse generated value stored in model.js
Link to #4077
parent 0d325877
Pipeline #116421 passed with stages
in 6 minutes and 38 seconds
......@@ -1770,7 +1770,7 @@ Clone.prototype = {
}
var values = []
var axes_obj = this.m.axes
var available_axes = axes_obj.available()
var available_axes = this.m.available_axes
for (var a = 0; a < axes.length; a++) {
var axe = axes[a]
......@@ -1882,9 +1882,8 @@ Clone.prototype = {
value = tmpValue
}
var axes_obj = this.m.axes
var naxe = this.m.distrib_convertion[axe]
var available_axes = axes_obj.available()
var available_axes = this.m.available_axes
if (available_axes[naxe] != undefined) {
if (available_axes[naxe].set != undefined) {
available_axes[naxe].set(this, value)
......
......@@ -63,6 +63,7 @@ function Model() {
this.NORM_EXTERNAL = "external"
this.normalization_mode = this.NORM_FALSE
this.axes = new Axes(this)
this.available_axes = this.axes.available()
setInterval(function(){return self.updateIcon()}, 100);
}
......
......@@ -657,7 +657,7 @@ Segment.prototype = {
fillAxisBox: function (axisBox, clone) {
axisBox.removeAllChildren();
var axOpts = Clone.prototype.axisOptions();
var available_axis = (new Axes(this.m)).available();
var available_axis = this.m.available_axes
for (var i in this.selectedAxis) {
var span = document.createElement('span');
var axis = this.selectedAxis[i];
......
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