Index: trunk/kernel/admin_templates/incs/catalog.js =================================================================== diff -u -r5018 -r5022 --- trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5018) +++ trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5022) @@ -42,11 +42,6 @@ document.getElementById($params[0]).innerHTML = $text; } - if ($params[0] == 'categories_div') { - // category has been changed -> refresh current item tab - $Catalog.switchTab(); - } - if (isset($Debugger)) $Debugger.Clear(); } @@ -66,9 +61,16 @@ Catalog.prototype.go_to_cat = function($cat_id) { - if (!isset($cat_id)) { + if (!isset($cat_id)) { + // gets current category $cat_id = get_hidden_field('m_cat_id'); } + else { + // sets new category to kernel_form in case if item tab + // loads faster and will check if it's category is same + // as parent category of categories list + set_hidden_field('m_cat_id', $cat_id); + } // set all item tabs counters to "?" before quering catagories var $i = 1; @@ -79,7 +81,8 @@ // query sub categories of $cat_id var $url = this.URLMask.replace('#TEMPLATE_NAME#', 'xml/categories_list').replace('#CATEGORY_ID#', $cat_id); - Request.makeRequest($url, this.BusyRequest, 'categories_div', this.successCallback, this.errorCallback, 'categories_div'); + Request.makeRequest($url, this.BusyRequest, 'categories_div', this.successCallback, this.errorCallback, 'categories_div'); + this.switchTab(); // refresh current item tab } @@ -111,6 +114,9 @@ Request.makeRequest($url, this.BusyRequest, $div_id, this.successCallback, this.errorCallback, $div_id); } + /*else { + alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'}'); + }*/ } // adds information about tab to tab_registry