Commit d1e15a81 authored by Mikaël Salson's avatar Mikaël Salson

Merge branch...

Merge branch 'feature-c/3697-le-top-peut-il-descendre-en-dessous-de-50-sans-l-intervention-de-l-utliisateur-2' into 'dev'

Resolve "Le top peut-il descendre en dessous de 50 sans l'intervention de l'utliisateur ?"

Closes #3697

See merge request !402
parents 7eab549f f20d50c1
Pipeline #62931 failed with stages
in 17 minutes and 39 seconds
......@@ -1198,12 +1198,18 @@ changeAlleleNotation: function(alleleNotation) {
* */
displayTop: function (top) {
top = typeof top !== 'undefined' ? top : this.top;
if (top < 0)
top = 0
// Remember the top setted
// Allow to keep this values between various samples
this.top = top;
// top show cannot be greater than the number of clones
if (top > this.countRealClones())
top = this.countRealClones()
this.top = top;
this.current_top = top
var html_slider = document.getElementById('top_slider');
if (html_slider !== null) {
......
......@@ -116,7 +116,9 @@ QUnit.test("top clones", function(assert) {
m.displayTop(-10)
assert.equal(m.top, 0, "Top cannot be negative")
m.displayTop(m.countRealClones() * 2 + 10)
assert.equal(m.top, m.countRealClones(), "Top cannot be greater than the number of real clones")
assert.equal(m.top, m.countRealClones() * 2 + 10, "Model top can be greater than the number of real clones")
assert.equal(m.current_top, m.countRealClones(), "Current Top cannot be greater than the number of real clones")
m.displayTop(1)
......
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