[Laszlo-checkins] r14052 - openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml

max@openlaszlo.org max at openlaszlo.org
Wed Jun 3 18:46:02 PDT 2009


Author: max
Date: 2009-06-03 18:45:59 -0700 (Wed, 03 Jun 2009)
New Revision: 14052

Modified:
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
   openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
Log:
Change 20090602-maxcarlson-i by maxcarlson at Bank on 2009-06-02 16:37:12 PDT
    in /Users/maxcarlson/openlaszlo/trunk-clean
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Fix IE to select inputtexts that share the same area as a text

Bugs Fixed: LPP-8219 - IE DHTML: inputtext focus/selection issues

Technical Reviewer: hminsky
QA Reviewer: mdemmon

Details: LzSprite - Add textgrabsinputtextfocus quirk, set to true for IE.

LzInputTextSprite - __hideIfNotFocused():  Shorten lookups to LzInputTextSprite.prototype.  Look at the srcElement of the last event to see if it was an instance of LzTextSprite - this happens when an text is in the same area as an inputtext.  If this is the case, focus the inputtext and avoid hiding the shown inputtext.

Tests: Testcase from LPP-8219 and compose window in webtop mail allows the to: field to be selected in the area that says 'Drag a contact or type for autosuggest'.



Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js	2009-06-03 10:30:06 UTC (rev 14051)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzInputTextSprite.js	2009-06-04 01:45:59 UTC (rev 14052)
@@ -248,27 +248,39 @@
 }
 
 LzInputTextSprite.prototype.__hideIfNotFocused = function(eventname, target) {
-    if (LzInputTextSprite.prototype.__lastshown == null) return;
-    if (LzSprite.prototype.quirks.fix_ie_clickable) {
+    var lzinppr = LzInputTextSprite.prototype;
+    if (lzinppr.__lastshown == null) return;
+    var quirks = LzSprite.prototype.quirks;
+    if (quirks.fix_ie_clickable) {
         if (eventname == 'onmousemove') {
             // track mouse position for inputtext when global clickable is false
-            if (LzInputTextSprite.prototype.__globalclickable == false && LzInputTextSprite.prototype.__focusedSprite && target) {
-                if (target.owner != LzInputTextSprite.prototype.__focusedSprite) {
-                    LzInputTextSprite.prototype.__setglobalclickable(true);
+            if (lzinppr.__globalclickable == false && lzinppr.__focusedSprite && target) {
+                if (target.owner != lzinppr.__focusedSprite) {
+                    lzinppr.__setglobalclickable(true);
                 } else {
-                    LzInputTextSprite.prototype.__setglobalclickable(false);
+                    lzinppr.__setglobalclickable(false);
                 }
             }
             return;
-        } else if (eventname != null && LzInputTextSprite.prototype.__globalclickable == true) {
-            LzInputTextSprite.prototype.__setglobalclickable(false);
+        } else if (eventname != null && lzinppr.__globalclickable == true) {
+            lzinppr.__setglobalclickable(false);
         }
+        if (quirks.textgrabsinputtextfocus) {
+            var s = window.event;
+            if (s && s.srcElement && s.srcElement.owner && s.srcElement.owner instanceof LzTextSprite) {
+                //Debug.write('text intercepting focus', eventname, s.owner instanceof LzTextSprite);
+                if (eventname == 'onmousedown') {
+                    lzinppr.__lastshown.gotFocus();
+                }
+                return;
+            }
+        }
     }
-    if (LzInputTextSprite.prototype.__focusedSprite != LzInputTextSprite.prototype.__lastshown) {
-        LzInputTextSprite.prototype.__lastshown.__hide();
+    if (lzinppr.__focusedSprite != lzinppr.__lastshown) {
+        lzinppr.__lastshown.__hide();
     }
+}
 
-}
 LzInputTextSprite.prototype.__setglobalclickable = function(c) {
     if (! LzSprite.prototype.quirks.fix_ie_clickable) return;
     if (c != LzInputTextSprite.prototype.__globalclickable) {

Modified: openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js
===================================================================
--- openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js	2009-06-03 10:30:06 UTC (rev 14051)
+++ openlaszlo/trunk/WEB-INF/lps/lfc/kernel/dhtml/LzSprite.js	2009-06-04 01:45:59 UTC (rev 14052)
@@ -498,6 +498,7 @@
     ,inputtext_anonymous_div: false
     ,clipped_scrollbar_causes_display_turd: false
     ,detectstuckkeys: false
+    ,textgrabsinputtextfocus: false
 }
 
 LzSprite.prototype.capabilities = {
@@ -606,6 +607,8 @@
             quirks['scrollbar_width'] = 16;
             // CSS sprites conflict with ie_alpha_image_loader...
             quirks['use_css_sprites'] = ! quirks['ie_alpha_image_loader'];
+            // IE needs help focusing when an lztext is in the same area - LPP-8219
+            quirks['textgrabsinputtextfocus'] = true;
         } else if (browser.isSafari) {
             // Remap alt/option key also sends control since control-click shows context menu (see LPP-2584 - Lzpix: problem with multi-selecting images in Safari 2.0.4, dhtml)
             quirks['alt_key_sends_control'] = true;



More information about the Laszlo-checkins mailing list