You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by ce...@apache.org on 2002/03/05 12:24:37 UTC

cvs commit: jakarta-struts/contrib/tiles/web/doc/examples/tiles myPortalSettings.jsp myMenuSettings.jsp

cedric      02/03/05 03:24:37

  Modified:    contrib/tiles/web/doc/examples/tiles myPortalSettings.jsp
                        myMenuSettings.jsp
  Log:
  Improve javascript for items selection and moving in ie6
  
  Revision  Changes    Path
  1.2       +16 -8     jakarta-struts/contrib/tiles/web/doc/examples/tiles/myPortalSettings.jsp
  
  Index: myPortalSettings.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/tiles/web/doc/examples/tiles/myPortalSettings.jsp,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- myPortalSettings.jsp	27 Dec 2001 17:27:15 -0000	1.1
  +++ myPortalSettings.jsp	5 Mar 2002 11:24:36 -0000	1.2
  @@ -22,6 +22,7 @@
     opt = new Option( toMove.text, toMove.value, false, false );
     col1.options[col1.selectedIndex ] = null;
     col2.options[col2.length] = opt;
  +  col2.selectedIndex = col2.length-1;
     return true;
   }
   
  @@ -37,10 +38,13 @@
     if( index <= 0 )
       return true;
   	
  -  toMove = col1.options[ index ];
  -  opt = new Option( toMove.text, toMove.value, false, false );
  -  col1.options[index] = col1.options[index-1];
  -  col1.options[index-1] = opt;
  +  toMoveX = col1.options[ index -1 ];
  +  toMoveY = col1.options[ index ];
  +  optX = new Option( toMoveX.text, toMoveX.value, false, false );
  +  optY = new Option( toMoveY.text, toMoveY.value, false, false );
  +  col1.options[index] = optX;
  +  col1.options[index-1] = optY;
  +  col1.selectedIndex = index-1;
     return true;
   }
   
  @@ -50,10 +54,14 @@
     if( index+1 >=  col1.options.length )
       return true;
   	
  -  toMove = col1.options[ index ];
  -  opt = new Option( toMove.text, toMove.value, false, false );
  -  col1.options[index] = col1.options[index+1];
  -  col1.options[index+1] = opt;
  +  toMoveX = col1.options[ index ];
  +  toMoveY = col1.options[ index + 1 ];
  +  optX = new Option( toMoveX.text, toMoveX.value, false, false );
  +  optY = new Option( toMoveY.text, toMoveY.value, false, false );
  +  col1.options[index] = optY;
  +  col1.options[index+1] = optX;
  +  col1.selectedIndex = index+1;
  +
     return true;
   }
   
  
  
  
  1.3       +16 -8     jakarta-struts/contrib/tiles/web/doc/examples/tiles/myMenuSettings.jsp
  
  Index: myMenuSettings.jsp
  ===================================================================
  RCS file: /home/cvs/jakarta-struts/contrib/tiles/web/doc/examples/tiles/myMenuSettings.jsp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- myMenuSettings.jsp	18 Feb 2002 14:48:39 -0000	1.2
  +++ myMenuSettings.jsp	5 Mar 2002 11:24:36 -0000	1.3
  @@ -27,6 +27,7 @@
     opt = new Option( toMove.text, toMove.value, false, false );
     col1.options[col1.selectedIndex ] = null;
     col2.options[col2.length] = opt;
  +  col2.selectedIndex = col2.length-1;
     return true;
   }
   
  @@ -42,10 +43,13 @@
     if( index <= 0 )
       return true;
   	
  -  toMove = col1.options[ index ];
  -  opt = new Option( toMove.text, toMove.value, false, false );
  -  col1.options[index] = col1.options[index-1];
  -  col1.options[index-1] = opt;
  +  toMoveX = col1.options[ index -1 ];
  +  toMoveY = col1.options[ index ];
  +  optX = new Option( toMoveX.text, toMoveX.value, false, false );
  +  optY = new Option( toMoveY.text, toMoveY.value, false, false );
  +  col1.options[index] = optX;
  +  col1.options[index-1] = optY;
  +  col1.selectedIndex = index-1;
     return true;
   }
   
  @@ -55,10 +59,14 @@
     if( index+1 >=  col1.options.length )
       return true;
   	
  -  toMove = col1.options[ index ];
  -  opt = new Option( toMove.text, toMove.value, false, false );
  -  col1.options[index] = col1.options[index+1];
  -  col1.options[index+1] = opt;
  +  toMoveX = col1.options[ index ];
  +  toMoveY = col1.options[ index + 1 ];
  +  optX = new Option( toMoveX.text, toMoveX.value, false, false );
  +  optY = new Option( toMoveY.text, toMoveY.value, false, false );
  +  col1.options[index] = optY;
  +  col1.options[index+1] = optX;
  +  col1.selectedIndex = index+1;
  +
     return true;
   }
   
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>