gutter support
This commit is contained in:
parent
9315c374e6
commit
99b81b0b04
4 changed files with 65 additions and 12 deletions
22
GutterLayer.js
Normal file
22
GutterLayer.js
Normal 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("");
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue