1 // VIEW 2 3 /** 4 * This track is for (e.g.) position and sequence information that should 5 * always stay visible at the top of the view. 6 * @class 7 */ 8 9 function StaticTrack(name, labelClass, posHeight) { 10 Track.call(this, name, name, true, function() {}); 11 this.labelClass = labelClass; 12 this.posHeight = posHeight; 13 this.height = posHeight; 14 } 15 16 StaticTrack.prototype = new Track(""); 17 18 StaticTrack.prototype.fillBlock = function(blockIndex, block, 19 leftBlock, rightBlock, 20 leftBase, rightBase, scale, 21 padding, stripeWidth) { 22 var posLabel = document.createElement("div"); 23 var numtext = Util.addCommas( leftBase+1 ); 24 posLabel.className = this.labelClass; 25 26 // give the position label a negative left offset in ex's to 27 // more-or-less center it over the left boundary of the block 28 posLabel.style.left = "-" + Number(numtext.length)/1.7 + "ex"; 29 30 posLabel.appendChild( document.createTextNode( numtext ) ); 31 block.appendChild(posLabel); 32 this.heightUpdate(this.posHeight, blockIndex); 33 }; 34