- select: function(ev, ui) {
- window.location.hash = ui.tab.hash;
+ beforeActivate: function(ev, ui) {
+ sync_anchor(ui.newPanel.selector);
+ if ( ui.newTab.find('input[type=text]').size() > 0 ) {
+ ui.newTab.find('input[type=text]:first').focus();
+ }
+ }
+ });
+
+ jQuery(".rights-editor .category-tabs").tabs({
+ 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", "active") || 0;
+ if (selected != ui.newTab.index())
+ item.tabs("option", "active", ui.newTab.index());
+ });