Revision: 2959
          http://vexi.svn.sourceforge.net/vexi/?rev=2959&view=rev
Author:   clrg
Date:     2008-07-08 07:39:26 -0700 (Tue, 08 Jul 2008)

Log Message:
-----------
Fix selected sometimes being null (now always true or false)

Modified Paths:
--------------
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t
    trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/check.t

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t   
2008-07-08 01:42:14 UTC (rev 2958)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/role/selectable.t   
2008-07-08 14:39:26 UTC (rev 2959)
@@ -109,8 +109,8 @@
         return ps;
     }
     
-    /** selected read trap */
-    static.selectedRead = function() { return trapee.mixed or cascade; }
+    /** selected read trap - use 'cascade == true' to guarrantee booleans */
+    static.selectedRead = function() { return trapee.mixed or (cascade == 
true); }
     
     /** selected write trap */
     static.selectedWrite = function(v) {
@@ -127,7 +127,8 @@
             } else if (g.selected == t)
                 g.selected = null;
         }
-        cascade = v;
+        // to avoid selected == null
+        cascade = v == true;
     }
     
     /** selection by keyboard navigation for selectable groups */

Modified: trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/check.t
===================================================================
--- trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/check.t      
2008-07-08 01:42:14 UTC (rev 2958)
+++ trunk/widgets/org.vexi.widgets/src/org/vexi/lib/widget/check.t      
2008-07-08 14:39:26 UTC (rev 2959)
@@ -23,7 +23,7 @@
     </ui:box>
     
     static.actionWrite = function(v) { trapee.selected = !trapee.selected; 
cascade = v; }
-    static.valueWrite = function(v) { trapee.selected = true and v; return; }
-    static.valueRead = function() { return true and trapee.selected; }
+    static.valueWrite = function(v) { trapee.selected = v == true; return; }
+    static.valueRead = function() { return trapee.selected == true; }
     
 </vexi>


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to