Author: max
Date: 2006-11-13 10:40:40 -0800 (Mon, 13 Nov 2006)
New Revision: 2506

Modified:
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.as
   openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.js
   openlaszlo/branches/legals/lps/components/base/basedatacombobox.lzx
   openlaszlo/branches/legals/lps/components/base/basescrollbar.lzx
Log:
Change 20061109-maxcarlson-C by [EMAIL PROTECTED] on 2006-11-09 13:49:10 PST
    in /Users/maxcarlson/openlaszlo/legals

Summary: Fix datacombobox

New Features:

Bugs Fixed: LPP-2936 - Make datacombobox work in Legals

Technical Reviewer: promanik
QA Reviewer: hminsky
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:


Tests: 
http://localhost:8080/legals/examples/components/datacombobox_example.lzx?lzr=dhtml

Files:
M      lps/components/base/basedatacombobox.lzx

Changeset: 
http://svn.openlaszlo.org/openlaszlo/patches/20061109-maxcarlson-C.tar

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.as
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.as      
2006-11-13 17:38:49 UTC (rev 2505)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.as      
2006-11-13 18:40:40 UTC (rev 2506)
@@ -29,6 +29,7 @@
 // should we create a bounding rect for the views, or instead register a view
 // as a groups bounding rect.
 LzTrack.register = function ( v, group ){
+    if (v == null || group == null) return;
     if (typeof(this.__LZreg[group]) == "undefined") {
          this.__LZreg[group] = [];
           // __LZlasthit means that onmousedownover has been sent to this view,
@@ -48,16 +49,19 @@
 // @keywords private
 //-----------------------------------------------------------------------------
 LzTrack.unregister = function ( v, group ){
+    if (v == null || group == null) return;
     var reglist = this.__LZreg[group];
-    for (var i = 0; i < reglist.length; i++) {
-         if (reglist[i] == v) {
-            reglist.splice(i, 1);
-         }
-    }
-    // Remove empty groups
-    if (reglist.length == 0) {
-        delete this.__LZreg[group];
-    }
+    if (reglist) {
+        for (var i = 0; i < reglist.length; i++) {
+            if (reglist[i] == v) {
+                reglist.splice(i, 1);
+            }
+        }
+        // Remove empty groups
+        if (reglist.length == 0) {
+            delete this.__LZreg[group];
+        }
+    }    
     this.__LZdestroydel.unregisterFrom(v.ondestroy);
 }
 

Modified: openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.js
===================================================================
--- openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.js      
2006-11-13 17:38:49 UTC (rev 2505)
+++ openlaszlo/branches/legals/WEB-INF/lps/lfc/services/LzTrack.js      
2006-11-13 18:40:40 UTC (rev 2506)
@@ -31,6 +31,7 @@
 // should we create a bounding rect for the views, or instead register a view
 // as a groups bounding rect.
 LzTrack.register = function ( v, group ){
+    if (v == null || group == null) return;
     if (typeof(this.__LZreg[group]) == "undefined") {
          this.__LZreg[group] = [];
           // __LZlasthit means that onmousedownover has been sent to this view,
@@ -50,16 +51,19 @@
 // @keywords private
 //-----------------------------------------------------------------------------
 LzTrack.unregister = function ( v, group ){
+    if (v == null || group == null) return;
     var reglist = this.__LZreg[group];
-    for (var i = 0; i < reglist.length; i++) {
-         if (reglist[i] == v) {
-            reglist.splice(i, 1);
-         }
-    }
-    // Remove empty groups
-    if (reglist.length == 0) {
-        delete this.__LZreg[group];
-    }
+    if (reglist) {
+        for (var i = 0; i < reglist.length; i++) {
+            if (reglist[i] == v) {
+                reglist.splice(i, 1);
+            }
+        }
+        // Remove empty groups
+        if (reglist.length == 0) {
+            delete this.__LZreg[group];
+        }
+    }    
     this.__LZdestroydel.unregisterFrom(v.ondestroy);
 }
 

Modified: openlaszlo/branches/legals/lps/components/base/basedatacombobox.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/base/basedatacombobox.lzx 
2006-11-13 17:38:49 UTC (rev 2505)
+++ openlaszlo/branches/legals/lps/components/base/basedatacombobox.lzx 
2006-11-13 18:40:40 UTC (rev 2506)
@@ -241,7 +241,7 @@
                 this._cbtext.setText(t);
             }
 
-            if ( dp['p'] == this.selected['p'] ) return;
+            if ( this.selected && dp['p'] == this.selected['p'] ) return;
 
             if (! (dontSetValue || this.ismenu)) {
                 var v = dp.xpathQuery(this.valuedatapath);

Modified: openlaszlo/branches/legals/lps/components/base/basescrollbar.lzx
===================================================================
--- openlaszlo/branches/legals/lps/components/base/basescrollbar.lzx    
2006-11-13 17:38:49 UTC (rev 2505)
+++ openlaszlo/branches/legals/lps/components/base/basescrollbar.lzx    
2006-11-13 18:40:40 UTC (rev 2506)
@@ -274,12 +274,14 @@
 
         <!---  @keywords private -->
         <method name="updateThumbPos">
+        <![CDATA[
             var new_pos = 0;
-            if (this.scrollmax > 0)  {
+            if (this.scrollmax > 0 && this.scrolltrack && this.scrolltarget)  {
                 new_pos = 
Math.min(Math.ceil((-this.scrolltarget[this.scrollattr]/this.scrollmax)
                        *this.scrolltrack[this.sizeAxis]), 
(this.scrolltrack[this.sizeAxis])-this.thumb[this.sizeAxis]);
             }
             this.thumb.setAttribute(this.axis, new_pos);
+        ]]>
         </method>
 
         <!--- Subclasses can override to change visual state when the 
scrollable
@@ -296,20 +298,21 @@
         <method name="updateThumbSize">
             <![CDATA[
             // disable/enable the scrollbar if necessary
-            if (this.scrollmax <= 
this.scrolltarget.immediateparent[this.sizeAxis]) {
-                    if (this.scrollable) this.setAttribute('scrollable',false);
-                    return;
+            if (this.scrolltarget && this.scrollmax <= 
this.scrolltarget.immediateparent[this.sizeAxis]) {
+                if (this.scrollable) this.setAttribute('scrollable',false);
+                return;
             } else {
                 if (!this.scrollable) this.setAttribute('scrollable', true);
-           }
-              var newsize = 0;
-              if (this.scrollmax > 0) {
-                  newsize = Math.floor(
-                
(this.scrolltarget.immediateparent[this.sizeAxis]/this.scrollmax)
-                    *scrolltrack[this.sizeAxis]);
-              }
-              if (newsize < 14) newsize = 14;
-              thumb.setAttribute(this.sizeAxis, newsize);
+            } 
+            
+            var newsize = 0;
+            if (this.scrollmax > 0 && this.scrolltrack && this.scrolltarget) {
+                newsize = Math.floor(
+                    
(this.scrolltarget.immediateparent[this.sizeAxis]/this.scrollmax)
+                    *this.scrolltrack[this.sizeAxis]);
+            }
+            if (newsize < 14) newsize = 14;
+            thumb.setAttribute(this.sizeAxis, newsize);
             ]]>
         </method>
 


_______________________________________________
Laszlo-checkins mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-checkins

Reply via email to