Commit 12f92788 authored by flothoni's avatar flothoni Committed by Mathieu Giraud

Segmenter.js; add a switch to hide multiple tag span of no clones are selected

Also add a title to the div for accessibility. 
Link to #1292
parent 2cc7e88b
...@@ -1950,8 +1950,8 @@ changeAlleleNotation: function(alleleNotation) { ...@@ -1950,8 +1950,8 @@ changeAlleleNotation: function(alleleNotation) {
* */ * */
openTagSelector: function (clonesIDs, e) { openTagSelector: function (clonesIDs, e) {
var self = this; var self = this;
cloneID = typeof cloneID !== 'undefined' ? cloneID : this.cloneID;
this.tagSelectorList.removeAllChildren(); this.tagSelectorList.removeAllChildren();
clonesIDs = clonesIDs !== undefined ? clonesIDs : this.clonesIDs;
this.clonesIDs=clonesIDs this.clonesIDs=clonesIDs
var buildTagSelector = function (i) { var buildTagSelector = function (i) {
......
...@@ -375,17 +375,16 @@ Segment.prototype = { ...@@ -375,17 +375,16 @@ Segment.prototype = {
// Tag/Star // Tag/Star
var span_star = document.createElement('span') var span_star = document.createElement('span')
span_star.setAttribute('class', 'starBox'); span_star.setAttribute('class', 'starBox');
span_star.setAttribute("title", 'Tag selected clones');
span_star.onclick = function (e) { span_star.onclick = function (e) {
self.m.openTagSelector(m.getSelected(), e); if (m.getSelected().length > 0) { self.m.openTagSelector(m.getSelected(), e); }
} }
span_star.id = self.index span_star.id = self.index
var tag_icon = document.createElement('i') var tag_icon = document.createElement('i')
tag_icon.id = "tag_icon__multiple" tag_icon.id = "tag_icon__multiple"
tag_icon.title = "clone_tag_multiple"
tag_icon.classList.add('icon-star-2') tag_icon.classList.add('icon-star-2')
span_star.appendChild(tag_icon) span_star.appendChild(tag_icon)
div_stats.appendChild(span_star); div_stats.appendChild(span_star);
div.appendChild(div_stats) div.appendChild(div_stats)
div_stats.appendChild(span_fixsegmenter); div_stats.appendChild(span_fixsegmenter);
...@@ -1058,6 +1057,12 @@ Segment.prototype = { ...@@ -1058,6 +1057,12 @@ Segment.prototype = {
} }
$(".stats_content").prop('title', s) $(".stats_content").prop('title', s)
} }
if (this.m.getSelected().length > 0){
$("#tag_icon__multiple").css("display", "")
} else {
$("#tag_icon__multiple").css("display", "none")
}
}, },
/** /**
......
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