Commit 8b1026b2 authored by marc duez's avatar marc duez

model.js : filter should be applied on all clones not only the visibles ones

parent 9b857aa5
Pipeline #153589 failed with stages
in 11 minutes and 37 seconds
......@@ -2719,7 +2719,7 @@ changeAlleleNotation: function(alleleNotation) {
focusSelected: function () {
for (var i=0; i<this.clones.length; i++){
var c = this.clone(i)
c.isFiltered = c.isFiltered || ( !c.isSelected() && c.isActive() )
c.isFiltered = c.isFiltered || ( !c.isSelected() )
}
$("#filter_input").val("(focus on some clones)")
this.update()
......
......@@ -723,3 +723,24 @@ QUnit.test("clonedb", function(assert) {
assert.equal(m.clones[1].numberInCloneDB(), undefined, "");
assert.equal(m.clones[1].numberSampleSetInCloneDB(), undefined, "");
});
QUnit.test('clone: focus filter', function(assert) {
var m = new Model();
m.parseJsonData(json_data)
var c1 = new Clone(json_clone1, m, 0, c_attributes)
var c2 = new Clone(json_clone2, m, 1, c_attributes)
var c3 = new Clone(json_clone3, m, 2, c_attributes)
var c4 = new Clone(json_clone4, m, 3, c_attributes)
m.initClones()
m.displayTop(2)
m.select(0)
m.select(2)
m.focusSelected()
assert.equal(m.clone(0).isFiltered, false, 'clone 1 should NOT have been filtered out (selected)')
assert.equal(m.clone(1).isFiltered, true , 'clone 2 should have been filtered out (not selected)')
assert.equal(m.clone(2).isFiltered, false, 'clone 3 should NOT have been filtered out (selected) even if it was not visible')
assert.equal(m.clone(3).isFiltered, true , 'clone 4 should have been filtered out (not selected) even if it was not visible')
});
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