[Laszlo-checkins] r14283 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml
max@openlaszlo.org
max at openlaszlo.org
Tue Jul 7 14:43:29 PDT 2009
Author: max
Date: 2009-07-07 14:43:28 -0700 (Tue, 07 Jul 2009)
New Revision: 14283
Modified:
openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
Log:
Change 20090707-maxcarlson-9 by maxcarlson at Bank on 2009-07-07 12:35:49 PDT
in /Users/maxcarlson/openlaszlo/trunk-clean
for http://svn.openlaszlo.org/openlaszlo/trunk
Summary: Cache/restore inputtext selection when disabling global clickability
Bugs Fixed: LPP-8289 - Mousing over an iframe while cursor is in a text component makes the cursor disappear
Technical Reviewer: ptw
QA Reviewer: hminsky
Details: Cache inputtext selection when global clickability is turned off, usually by an iframe/html component. Restore the selection when clickability is turned back on.
Tests: See testcase attached to lpp-8289. Modify test.lzx to return instead of restoring the focus. Notice that the correct selection/cursor position is restored when mousing into/out of the red box.
Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2009-07-07 19:48:59 UTC (rev 14282)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzMouseKernel.js 2009-07-07 21:43:28 UTC (rev 14283)
@@ -187,8 +187,15 @@
if (this.__resetonmouseover) {
this.__resetonmouseover = false;
this.setGlobalClickable(true);
+ var cs = this.__cachedSelection;
+ if (cs) {
+ var sprite = cs.s;
+ sprite.setSelection(cs.st, cs.st + cs.sz);
+ cs = null;
+ }
}
}
+ ,__cachedSelection: null
,setGlobalClickable: function (isclickable){
//Debug.error('setGlobalClickable', isclickable, LzInputTextSprite.prototype.__lastfocus, LzInputTextSprite.prototype.__focusedSprite, LzInputTextSprite.prototype.__lastshown);
if (! isclickable) {
@@ -196,6 +203,7 @@
var lzinputproto = LzInputTextSprite.prototype;
var lastshown = lzinputproto.__lastshown;
if (lastshown) {
+ LzMouseKernel.__cachedSelection = {s: lastshown, st: lastshown.getSelectionPosition(), sz: lastshown.getSelectionSize()};
lastshown.__hide();
lzinputproto.__lastshown = null;
}
More information about the Laszlo-checkins
mailing list