Skip to content

Commit

Permalink
split UITrack.js into StaticTrack.js and GridTrack.js.
Browse files Browse the repository at this point in the history
let's try to keep things strictly one class per file, unless the class
is not used anywhere outside of a file
  • Loading branch information
rbuels committed Mar 1, 2012
1 parent 5850fd1 commit 3f416f7
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 56 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
<script type="text/javascript" src="js/SequenceTrack.js"></script>
<script type="text/javascript" src="js/Layout.js"></script>
<script type="text/javascript" src="js/FeatureTrack.js"></script>
<script type="text/javascript" src="js/UITracks.js"></script>
<script type="text/javascript" src="js/StaticTrack.js"></script>
<script type="text/javascript" src="js/GridTrack.js"></script>
<script type="text/javascript" src="js/ImageTrack.js"></script>
<script type="text/javascript" src="js/GenomeView.js"></script>
<script type="text/javascript" src="js/touchJBrowse.js"></script>
Expand Down
18 changes: 18 additions & 0 deletions js/GridTrack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//This track is for drawing the vertical gridlines

function GridTrack(name) {
Track.call(this, name, name, true, function() {});
}

GridTrack.prototype = new Track("");

GridTrack.prototype.fillBlock = function(blockIndex, block,
leftBlock, rightBlock,
leftBase, rightBase, scale,
padding, stripeWidth) {
var gridline = document.createElement("div");
gridline.className = "gridline";
gridline.style.cssText = "left: 0%; width: 0px;";
block.appendChild(gridline);
this.heightUpdate(100, blockIndex);
};
23 changes: 23 additions & 0 deletions js/StaticTrack.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//This track is for (e.g.) position and sequence information that should
//always stay visible at the top of the view

function StaticTrack(name, labelClass, posHeight) {
Track.call(this, name, name, true, function() {});
this.labelClass = labelClass;
this.posHeight = posHeight;
this.height = posHeight;
}

StaticTrack.prototype = new Track("");

StaticTrack.prototype.fillBlock = function(blockIndex, block,
leftBlock, rightBlock,
leftBase, rightBase, scale,
padding, stripeWidth) {
var posLabel = document.createElement("div");
posLabel.className = this.labelClass;
posLabel.appendChild(document.createTextNode(Util.addCommas(leftBase)));
posLabel.style.top = "0px";// y + "px";
block.appendChild(posLabel);
this.heightUpdate(this.posHeight, blockIndex);
};
55 changes: 0 additions & 55 deletions js/UITracks.js

This file was deleted.

0 comments on commit 3f416f7

Please sign in to comment.