gutter support

This commit is contained in:
Fabian Jakobs 2010-04-07 16:27:17 +02:00
commit 99b81b0b04
4 changed files with 65 additions and 12 deletions

22
GutterLayer.js Normal file
View file

@ -0,0 +1,22 @@
function GutterLayer(parentEl)
{
this.element = document.createElement("div");
this.element.className = "layer gutter-layer";
parentEl.appendChild(this.element);
}
GutterLayer.prototype.update = function(config)
{
var html = [];
for (var i=config.firstRow; i<config.lastRow; i++)
{
html.push(
"<div class='gutter-cell' style='height:" + config.lineHeight + "px;'>",
i,
"</div>"
);
html.push("</div>");
}
this.element.innerHTML = html.join("");
};