Skip to content

Commit

Permalink
bugfix to subfeature styles: subfeature CSS classes were not being ap…
Browse files Browse the repository at this point in the history
…plied
  • Loading branch information
rbuels committed Mar 8, 2012
1 parent 9c277b5 commit fb4a18d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 32 deletions.
18 changes: 1 addition & 17 deletions genome.css
Original file line number Diff line number Diff line change
Expand Up @@ -527,27 +527,11 @@ div.cds-hist {
cursor: pointer;
}

.plus-triangle {
position:absolute;
height: 0px;
border-style: solid;
border-width: 6px 3px 0px 3px;
cursor: pointer;
}

.minus-triangle {
position:absolute;
height: 0px;
border-style: solid;
border-width: 0px 3px 6px 3px;
cursor: pointer;
}

.triangle {
position:absolute;
height: 0px;
border-style: solid;
border-width: 6px 0px 0px 0px;
border-width: 6px 3px 0px 3px;
cursor: pointer;
}

Expand Down
29 changes: 14 additions & 15 deletions js/FeatureTrack.js
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ FeatureTrack.prototype.renderFeature = function(feature, uniqueId, block, scale,
}

var subfeatures = this.attrs.get(feature, "Subfeatures");
if (subfeatures) {
if( subfeatures ) {
for (var i = 0; i < subfeatures.length; i++) {
this.renderSubfeature(feature, featDiv,
subfeatures[i],
Expand Down Expand Up @@ -601,23 +601,22 @@ FeatureTrack.prototype.renderSubfeature = function(feature, featDiv, subfeature,

var subDiv = document.createElement("div");

if (this.subfeatureClasses) {
if( this.config.style.subfeatureClasses ) {
var type = this.attrs.get(subfeature, "Type");
var className = this.config.style.subfeatureClasses[type];
subDiv.className = this.config.style.subfeatureClasses[type];
switch (this.attrs.get(subfeature, "Strand")) {
case 1:
case '+':
subDiv.className = "plus-" + className; break;
case 0:
case '.':
case null:
case undefined:
subDiv.className = className; break;
case -1:
case '-':
subDiv.className = "minus-" + className; break;
case 1:
case '+':
subDiv.className += " plus-" + subDiv.className; break;
case 0:
case '.':
case null:
case undefined:
subDiv.className = className; break;
case -1:
case '-':
subDiv.className += " minus-" + subDiv.className; break;
}

}

// if the feature has been truncated to where it doesn't cover
Expand Down

0 comments on commit fb4a18d

Please sign in to comment.