fix indentation in layer/text.js
This commit is contained in:
parent
8307e6db90
commit
9ba2816369
1 changed files with 14 additions and 14 deletions
|
|
@ -97,27 +97,27 @@ var Text = function(parentEl) {
|
||||||
this.$measureSizes = function() {
|
this.$measureSizes = function() {
|
||||||
var n = 1000;
|
var n = 1000;
|
||||||
if (!this.$measureNode) {
|
if (!this.$measureNode) {
|
||||||
var measureNode = this.$measureNode = dom.createElement("div");
|
var measureNode = this.$measureNode = dom.createElement("div");
|
||||||
var style = measureNode.style;
|
var style = measureNode.style;
|
||||||
|
|
||||||
style.width = style.height = "auto";
|
style.width = style.height = "auto";
|
||||||
style.left = style.top = (-n * 40) + "px";
|
style.left = style.top = (-n * 40) + "px";
|
||||||
|
|
||||||
style.visibility = "hidden";
|
style.visibility = "hidden";
|
||||||
style.position = "absolute";
|
style.position = "absolute";
|
||||||
style.overflow = "visible";
|
style.overflow = "visible";
|
||||||
style.whiteSpace = "nowrap";
|
style.whiteSpace = "nowrap";
|
||||||
|
|
||||||
// in FF 3.6 monospace fonts can have a fixed sub pixel width.
|
// in FF 3.6 monospace fonts can have a fixed sub pixel width.
|
||||||
// that's why we have to measure many characters
|
// that's why we have to measure many characters
|
||||||
// Note: characterWidth can be a float!
|
// Note: characterWidth can be a float!
|
||||||
measureNode.innerHTML = lang.stringRepeat("Xy", n);
|
measureNode.innerHTML = lang.stringRepeat("Xy", n);
|
||||||
|
|
||||||
var container = this.element.parentNode;
|
var container = this.element.parentNode;
|
||||||
while (!dom.hasCssClass(container, "ace_editor"))
|
while (!dom.hasCssClass(container, "ace_editor"))
|
||||||
container = container.parentNode;
|
container = container.parentNode;
|
||||||
|
|
||||||
container.appendChild(measureNode);
|
container.appendChild(measureNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
var style = this.$measureNode.style;
|
var style = this.$measureNode.style;
|
||||||
|
|
@ -235,7 +235,7 @@ var Text = function(parentEl) {
|
||||||
|
|
||||||
var html = [];
|
var html = [];
|
||||||
if (tokens.length > row-firstRow)
|
if (tokens.length > row-firstRow)
|
||||||
this.$renderLine(html, row, tokens[row-firstRow].tokens);
|
this.$renderLine(html, row, tokens[row-firstRow].tokens);
|
||||||
// don't use setInnerHtml since we are working with an empty DIV
|
// don't use setInnerHtml since we are working with an empty DIV
|
||||||
lineEl.innerHTML = html.join("");
|
lineEl.innerHTML = html.join("");
|
||||||
fragment.appendChild(lineEl);
|
fragment.appendChild(lineEl);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue