Commit 97fc3c9f authored by Marc Duez's avatar Marc Duez Committed by Mathieu Giraud

list.js / model.js : split_all function() can open all clones at once

- button added to list_menu
parent 4320cfdd
......@@ -247,7 +247,7 @@ Builder.prototype = {
a.onclick = function () {
var newPointName = document.getElementById("new_point_name")
.value;
self.m.time[self.point] = newPointName
self.m.time[self.m.t] = newPointName
self.build_info_container()
self.m.update()
}
......@@ -382,7 +382,7 @@ Builder.prototype = {
var div_system = this.build_info_line("info_system", "system", this.m.system)
//point info
var div_point = this.build_info_line("info_point", "point", this.m.time[this.point])
var div_point = this.build_info_line("info_point", "point", this.m.time[this.m.t])
var span = document.createElement('span')
span.appendChild(document.createTextNode("..."));
span.className = "edit_button"
......
......@@ -53,9 +53,43 @@ List.prototype = {
var div_parent = document.getElementById(this.id);
div_parent.innerHTML = "";
var div_list_menu = this.build_list_menu()
var div_list_clones = document.createElement('div')
div_list_clones.id = "list_clones"
for (var i = 0; i < this.m.n_windows; i++) {
var div = document.createElement('li');
div.className = "list";
div.id = i;
div_list_clones.appendChild(div);
}
div_parent.appendChild(div_list_menu)
div_parent.appendChild(div_list_clones)
},
build_list_menu: function () {
var div_list_menu = document.createElement('div')
div_list_menu.id = "list_menu"
var a_split = document.createElement('a')
a_split.className = "button"
a_split.appendChild(document.createTextNode("+"))
a_split.onclick = function () {
self.m.split_all(true)
}
var a_unsplit = document.createElement('a')
a_unsplit.className = "button"
a_unsplit.appendChild(document.createTextNode("-"))
a_unsplit.onclick = function () {
self.m.split_all(false)
}
var a_sortV = document.createElement('a')
a_sortV.className = "button"
a_sortV.appendChild(document.createTextNode("V sort"))
......@@ -73,32 +107,19 @@ List.prototype = {
var a_sort = document.createElement('a')
a_sort.className = "button"
a_sort.appendChild(document.createTextNode("sort"))
a_sort.style.float = "right";
a_sort.style.marginRight = "75px";
a_sort.onclick = function () {
self.sortListBySize()
}
div_list_menu.appendChild(a_split)
div_list_menu.appendChild(a_unsplit)
div_list_menu.appendChild(a_sortV)
div_list_menu.appendChild(a_sortJ)
div_list_menu.appendChild(a_sort)
var div_list_clones = document.createElement('div')
div_list_clones.id = "list_clones"
for (var i = 0; i < this.m.n_windows; i++) {
var div = document.createElement('li');
div.className = "list";
div.id = i;
div_list_clones.appendChild(div);
}
div_parent.appendChild(div_list_menu)
div_parent.appendChild(div_list_clones)
return div_list_menu
},
......
......@@ -754,6 +754,10 @@ Model.prototype = {
min_size = min_size*10
this.precision=this.precision*10
}
this.scale_color = d3.scale.log()
.domain([1, this.precision])
.range([250, 0]);
},
/*
......@@ -1414,7 +1418,14 @@ Model.prototype = {
}
return result
},
split_all: function (bool) {
for (var i=0; i < this.clones.length; i++) {
this.clones[i].split = bool
}
this.update()
},
} //end prototype Model
......
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