[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pear-cvs
Subject:    [PEAR-CVS] cvs: pear /HTML_QuickForm_advmultiselect qfamsHandler.js
From:       "Laurent Laville" <farell () php ! net>
Date:       2009-01-30 14:30:02
Message-ID: cvsfarell1233325802 () cvsserver
[Download RAW message or body]

farell		Fri Jan 30 14:30:02 2009 UTC

  Modified files:              
    /pear/HTML_QuickForm_advmultiselect	qfamsHandler.js 
  Log:
  prevent an item that have "disabled" attribute to be selected with SelectAll button \
or deselected with SelectNone button  
http://cvs.php.net/viewvc.cgi/pear/HTML_QuickForm_advmultiselect/qfamsHandler.js?r1=1.8&r2=1.9&diff_format=u
                
Index: pear/HTML_QuickForm_advmultiselect/qfamsHandler.js
diff -u pear/HTML_QuickForm_advmultiselect/qfamsHandler.js:1.8 \
                pear/HTML_QuickForm_advmultiselect/qfamsHandler.js:1.9
--- pear/HTML_QuickForm_advmultiselect/qfamsHandler.js:1.8	Mon Jan 26 21:51:12 2009
+++ pear/HTML_QuickForm_advmultiselect/qfamsHandler.js	Fri Jan 30 14:30:01 2009
@@ -6,7 +6,7 @@
  * @author     Laurent Laville <pear@laurent-laville.org>
  * @copyright  2007-2009 Laurent Laville
  * @license    http://www.opensource.org/licenses/bsd-license.php  New BSD License
- * @version    CVS: $Id: qfamsHandler.js,v 1.8 2009/01/26 21:51:12 farell Exp $
+ * @version    CVS: $Id: qfamsHandler.js,v 1.9 2009/01/30 14:30:01 farell Exp $
  * @since      File available since Release 1.3.0
  */
 
@@ -175,14 +175,18 @@
     // Add items to the 'TO' list.
     for (i = 0; i < source.length; i++) {
         if (action === 'all' || action === 'none' || action === 'toggle' || \
                source.options[i].selected === true) {
-            target.options[target.length] = new Option(source.options[i].text, \
source.options[i].value); +            if (source.options[i].disabled === false) {
+                target.options[target.length] = new Option(source.options[i].text, \
source.options[i].value); +            }
         }
     }
 
     // Remove items from the 'FROM' list.
     for (i = (source.length - 1); i >= 0; i--) {
         if (action === 'all' || action === 'none' || action === 'toggle' || \
                source.options[i].selected === true) {
-            source.options[i] = null;
+            if (source.options[i].disabled === false) {
+                source.options[i] = null;
+            }
         }
     }
 



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic