[Rt-commit] rt branch, 4.0/ie8-js-too-early, created. rt-4.0.1rc1-37-g7cb33fe

Thomas Sibley trs at bestpractical.com
Thu Jun 9 12:07:04 EDT 2011


The branch, 4.0/ie8-js-too-early has been created
        at  7cb33fe00ba13313ff4204f5a6477947e5b53e67 (commit)

- Log -----------------------------------------------------------------
commit 7cb33fe00ba13313ff4204f5a6477947e5b53e67
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Jun 9 12:04:53 2011 -0400

    Make sure we run our inline javascript only once the DOM is ready
    
    IE8 is very picky about this and these pages will break due to trying to
    modify the DOM too early.
    
    This fixes rt3 #17600.

diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index 4e37e2b..5ef7389 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -109,6 +109,7 @@ for my $category (@$Principals) {
                name="AddPrincipalForRights-<% lc $AddPrincipal %>"
                id="AddPrincipalForRights-<% lc $AddPrincipal %>" />
         <script type="text/javascript">
+        jQuery(function() {
             jQuery("#AddPrincipalForRights-<% lc $AddPrincipal %>").keyup(function(){
                 toggle_addprincipal_validity(this, true);
             });
@@ -120,6 +121,7 @@ for my $category (@$Principals) {
                 change: addprincipal_onchange
             });
 % }
+        });
         </script>
 % my $type = lc $AddPrincipal eq 'user' ? loc('username') : loc($AddPrincipal);
         <span class="warning"><&|/l, $type &>Invalid [_1]</&></span>
diff --git a/share/html/Admin/Elements/SelectNewGroupMembers b/share/html/Admin/Elements/SelectNewGroupMembers
index de32b6b..27b6f70 100755
--- a/share/html/Admin/Elements/SelectNewGroupMembers
+++ b/share/html/Admin/Elements/SelectNewGroupMembers
@@ -49,6 +49,7 @@
 <label for="<% $Name %>Users"><&|/l&>Add user</&>:</label>
 <input type="text" value="" name="<% $Name %>Users" id="<% $Name %>Users" /><br />
 <script type="text/javascript">
+jQuery(function(){
     jQuery("#<% $Name %>Users").autocomplete({
         source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Users?return=Name;privileged=1;exclude=<% $user_ids |u %>",
         // Auto-submit once a user is chosen
@@ -57,6 +58,7 @@
             jQuery(event.target).closest("form").submit();
         }
     });
+});
 </script>
 % }
 
@@ -64,6 +66,7 @@
 <label for="<% $Name %>Groups"><&|/l&>Add group</&>:</label>
 <input type="text" value="" name="<% $Name %>Groups" id="<% $Name %>Groups" /><br />
 <script type="text/javascript">
+jQuery(function(){
     jQuery("#<% $Name %>Groups").autocomplete({
         source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Groups?exclude=<% $group_ids |u %>",
         // Auto-submit once a user is chosen
@@ -72,6 +75,7 @@
             jQuery(event.target).closest("form").submit();
         }
     });
+});
 </script>
 % }
 <%INIT>
diff --git a/share/html/Admin/Groups/index.html b/share/html/Admin/Groups/index.html
index 07f50ee..88dfe8b 100755
--- a/share/html/Admin/Groups/index.html
+++ b/share/html/Admin/Groups/index.html
@@ -55,6 +55,7 @@
 <&|/l&>Go to group</&>
 <input type="text" name="GroupString" value="" id="autocomplete-GroupString" />
 <script type="text/javascript">
+jQuery(function(){
     jQuery("#autocomplete-GroupString").autocomplete({
         source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Groups",
         // Auto-submit once a group is chosen
@@ -63,6 +64,7 @@
             jQuery(event.target).closest("form").submit();
         }
     });
+});
 </script>
 </form>
 
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index c0272ab..16d4b37 100755
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -60,6 +60,7 @@
 <&|/l&>Go to user</&>
 <input type="text" name="UserString" value="" id="autocomplete-UserString" />
 <script type="text/javascript">
+jQuery(function(){
     jQuery("#autocomplete-UserString").autocomplete({
         source: "<% RT->Config->Get('WebPath')%>/Helpers/Autocomplete/Users?return=Name",
         // Auto-submit once a user is chosen
@@ -68,6 +69,7 @@
             jQuery(event.target).closest("form").submit();
         }
     });
+});
 </script>
 </form>
 

-----------------------------------------------------------------------


More information about the Rt-commit mailing list