Skip to content

Commit

Permalink
FLUID-4500: Added more comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
cindyli committed Oct 4, 2011
1 parent dc0bb80 commit 4e02900
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/webapp/components/uiOptions/js/UIEnhancer.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,12 @@ var fluid_1_4 = fluid_1_4 || {};
};

// Interprets browser returned "line-height" value, either a string "normal" or a number with "px" suffix,
// into a numeric value in em
// into a numeric value in em.
// Return 0 when the line-height is not detectable (a fix for http://issues.fluidproject.org/browse/FLUID-4500).
fluid.uiEnhancer.numerizeLineHeight = function (lineHeight, fontSize) {
// Make sure lineHeight is defined. Undefined lineHeight occurs when the container being detected does not exist.
// Make sure lineHeight is defined.
// Undefined lineHeight occurs when the line-height value on the container is un-detectable,
// which appears on detecting it on the hidden div in firefox.
if (!lineHeight) {
return 0;
}
Expand Down Expand Up @@ -479,6 +482,8 @@ var fluid_1_4 = fluid_1_4 || {};
that.calcInitSize();
}

// that.initialSize equals 0 when the line-height value on the container is un-detectable.
// @ See fluid.uiEnhancer.numerizeLineHeight()
if (that.initialSize > 0) {
var newLineSpacing = times === "" || times === 1 ? that.initialSize : times * that.initialSize;
that.container.css("line-height", newLineSpacing + "em");
Expand Down

0 comments on commit 4e02900

Please sign in to comment.