Change 20100325-hqm-i by [email protected] on 2010-03-25 15:07:05 EDT
in /Users/hqm/openlaszlo/trunk
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: fix for autosizing of inputtext fields
New Features:
Bugs Fixed: LPP-8591
Technical Reviewer: max
QA Reviewer: ptw
Doc Reviewer: (pending)
Documentation:
Release Notes:
Overview:
Fix autosizing behavior for inputtext fields.
Details:
LaszloView.lzs: make updateHeight() update the cached height value
LzText.lzs: set_text and set_width call updateHeight instead of the height
setter,
to prevent the hassetheight flag from getting incorrectly set on autosizing
text views.
LzInputText.lzs: Changed the call in inputtevent()'s onchange handler, to
use updateHeight() instead of the height setter (to prevent turning an
autosizing
field into a fixed height field)
LzSprite.js: modified CSS for multiline input text to use the whiteSpace='pre'
CSS option,
to get accurate height measurement.
LzTextSprite.js: Added 'sizeToHeight' flag, to track whether the the
sprite is autosizing. I know the kernel sprite shouldn't be ppeeking
at any more properties of the view, but we can do a real cleanup when
we design the new text class.
[One thing that would be nice is if we allowed the user to change from
a single line to a multiline inputtext dynamically, like you can do in
SWF. In DHTML, we'd have to destroy the DOM input div and make a new one]
LzInputTextSprite.js: in __textEvent(), use a technique to autosize the text
height,
by asking for it's scrollHeight. This seems to work in IE7, IE8, Firefox.
Safari does not like setting the height to zero.
Tests:
Test case at end of LPP-8591, run in FF, IE7, IE8, Safari, Chrome, Opera
1) Enter text to cause text field to grow in height, see that
background size matches the view height. See that no scrolling
happens.
2) Select all and delete text, see height of field and background
shrink to single line.
3) Try typing text that auto-wraps, i.e., words with spaces between
but no newlines. See that text height grows to contain text, with no
scrolling.
smokecheck
amazon demo
calendar demo
Files:
M WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
M WEB-INF/lps/lfc/kernel/dhtml/LzTextSprite.js
M WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
M WEB-INF/lps/lfc/views/LzInputText.lzs
M WEB-INF/lps/lfc/views/LzText.lzs
M WEB-INF/lps/lfc/views/LaszloView.lzs
Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100325-hqm-i.tar