You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pluto-scm@portals.apache.org by at...@apache.org on 2010/05/28 01:54:56 UTC

svn commit: r949044 - in /portals/pluto: branches/pluto-2.0.x/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp

Author: ate
Date: Thu May 27 23:54:56 2010
New Revision: 949044

URL: http://svn.apache.org/viewvc?rev=949044&view=rev
Log:
PLUTO-575: Javascript fails to correctly clear out select boxes
See: https://issues.apache.org/jira/browse/PLUTO-575
Reported and fix provided by Allan Jackson, thanks!

Modified:
    portals/pluto/branches/pluto-2.0.x/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp
    portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp

Modified: portals/pluto/branches/pluto-2.0.x/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/branches/pluto-2.0.x/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp?rev=949044&r1=949043&r2=949044&view=diff
==============================================================================
--- portals/pluto/branches/pluto-2.0.x/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp (original)
+++ portals/pluto/branches/pluto-2.0.x/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp Thu May 27 23:54:56 2010
@@ -46,8 +46,8 @@ limitations under the License.
 
           function <portlet:namespace/>doSwitchPage(select) {
               var placePortletsSelect = document.forms['adminForm'].elements['placedPortlets'];
-              for(var i=0; i < placePortletsSelect.options.length;i++) {
-                  placePortletsSelect.options[i] = null;
+              while (placePortletsSelect.options.length > 0) {
+                  placePortletsSelect.options[0] = null;
               }
 
               var disabled = select.value == 'Select. . .'
@@ -105,8 +105,8 @@ limitations under the License.
 
         function <portlet:namespace/>doSwitch(select) {
             var portletsSelectBox = document.forms['adminForm'].elements['availablePortlets'];
-            for(var i = 0; i < portletsSelectBox.options.length;i++) {
-                portletsSelectBox.options[i] = null;
+             while (portletsSelectBox.options.length > 0) {
+                portletsSelectBox.options[0] = null;
             }
             if (select.value == '-') {
                 document.forms['adminForm'].elements['availablePortlets'].disabled = true;

Modified: portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp
URL: http://svn.apache.org/viewvc/portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp?rev=949044&r1=949043&r2=949044&view=diff
==============================================================================
--- portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp (original)
+++ portals/pluto/trunk/pluto-portal/src/main/webapp/WEB-INF/fragments/admin/page/view.jsp Thu May 27 23:54:56 2010
@@ -46,8 +46,8 @@ limitations under the License.
 
           function <portlet:namespace/>doSwitchPage(select) {
               var placePortletsSelect = document.forms['adminForm'].elements['placedPortlets'];
-              for(var i=0; i < placePortletsSelect.options.length;i++) {
-                  placePortletsSelect.options[i] = null;
+              while (placePortletsSelect.options.length > 0) {
+                  placePortletsSelect.options[0] = null;
               }
 
               var disabled = select.value == 'Select. . .'
@@ -105,8 +105,8 @@ limitations under the License.
 
         function <portlet:namespace/>doSwitch(select) {
             var portletsSelectBox = document.forms['adminForm'].elements['availablePortlets'];
-            for(var i = 0; i < portletsSelectBox.options.length;i++) {
-                portletsSelectBox.options[i] = null;
+             while (portletsSelectBox.options.length > 0) {
+                portletsSelectBox.options[0] = null;
             }
             if (select.value == '-') {
                 document.forms['adminForm'].elements['availablePortlets'].disabled = true;