Index: branches/RC/kernel/admin_templates/incs/catalog.js =================================================================== diff -u -r8929 -r9524 --- branches/RC/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 8929) +++ branches/RC/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 9524) @@ -10,6 +10,7 @@ this.TabRegistry = new Array(); this.ActivePrefix = getCookie(this.CookiePrefix + 'active_prefix'); this.PreviousPrefix = this.ActivePrefix; + this.TabByCategory = false; // preselect tab by category (used in catalog only) $ViewMenus = new Array('c'); } @@ -68,9 +69,9 @@ }; Catalog.prototype.successCallback = function($request, $params, $object) { - + var $text = $request.responseText; - + var $match_redirect = new RegExp('^#redirect#(.*)').exec($text); if ($match_redirect != null) { // redirect to external template requested @@ -79,14 +80,14 @@ } $params = $params.split(','); - + var $js_end = $text.indexOf($object.Separator); if ($js_end != -1) { - + // allow to detect if output is permitted by ajax request parameters var $request_visible = '$request_visible = ' + ($params[0].length ? 'true' : 'false') + "\n"; - + if ($params[0].length) { document.getElementById($params[0]).innerHTML = $text.substring($js_end + $object.Separator.length); eval($request_visible + $text.substring(0, $js_end)); @@ -138,7 +139,7 @@ } -Catalog.prototype.go_to_cat = function($cat_id) { +Catalog.prototype.go_to_cat = function($cat_id, $module_prefix) { if (!isset($cat_id)) { // gets current category $cat_id = get_hidden_field('m_cat_id'); @@ -164,7 +165,7 @@ var $tab_id = this.TabRegistry[0]['tab_id']; this.BusyRequest[$prefix] = false; Request.makeRequest($url, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div', this); - this.switchTab(); // refresh current item tab + this.switchTab(this.TabByCategory ? $module_prefix : null); // refresh current item tab } // set all item tabs counters to "?" before quering catagories