[Rt-commit] rt branch, 4.2/fix-rights-editor-tab-state, created. rt-4.2.1-69-ge20d28b

? sunnavy sunnavy at bestpractical.com
Thu Feb 13 09:49:56 EST 2014


The branch, 4.2/fix-rights-editor-tab-state has been created
        at  e20d28bcb5f81ab3baafad110030f8df36202107 (commit)

- Log -----------------------------------------------------------------
commit e20d28bcb5f81ab3baafad110030f8df36202107
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Dec 30 21:58:34 2013 +0800

    js code update for new jquery-ui tabs used in EditRights
    
    new jquery-ui breaks current code and re-introduces the issue of #19205, i.e.
    "the user/group selection is not retained after submition in admin rights page"
    
    the main changes that affect here of tabs(since 1.10) are:
    * cookie support is removed
    * option selected => active
    * events select and show are removed

diff --git a/share/html/Admin/Elements/EditRights b/share/html/Admin/Elements/EditRights
index dc26d0f..5711b44 100644
--- a/share/html/Admin/Elements/EditRights
+++ b/share/html/Admin/Elements/EditRights
@@ -92,19 +92,20 @@ if ($anchor =~ /AddPrincipal/) {
       sync_anchor(<% $anchor |n,j %>);
 
       jQuery(".rights-editor").tabs({
-          select: function(ev, ui) {
-              sync_anchor(ui.tab.hash);
+          beforeActivate: function(ev, ui) {
+              sync_anchor(ui.newPanel.selector);
           }
       });
 
       jQuery(".rights-editor .category-tabs").tabs({
-          cookie: { name: "rights-category-tab" /* saves current tab in cookie */ },
-          show: function(ev, ui) {
+          active: jQuery.cookie('rights-category-tab') || 0,
+          activate: function(ev, ui) {
+              jQuery.cookie('rights-category-tab', ui.newTab.index());
               jQuery(".rights-editor .category-tabs").not(this).each(function() {
                   var item     = jQuery(this);
-                  var selected = item.tabs("option", "selected") || 0;
-                  if (selected != ui.index)
-                      item.tabs("select", ui.index);
+                  var selected = item.tabs("option", "active") || 0;
+                  if (selected != ui.newTab.index())
+                      item.tabs("option", "active", ui.newTab.index());
               });
           }
       });

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


More information about the rt-commit mailing list