Index: trunk/kernel/admin_templates/incs/catalog.js =================================================================== diff -u -r5026 -r5027 --- trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5026) +++ trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5027) @@ -48,14 +48,15 @@ alert('AJAX ERROR: ' + Request.getErrorHtml($request)); } -Catalog.prototype.submit_event = function($prefix_special, $event, $t, $result_div, $source_form) { - // set form name first, because set_hidden_field uses it - if (isset($source_form)) $form_name = $source_form; +Catalog.prototype.submit_event = function($prefix_special, $event, $t) { + if (!isset($prefix_special)) $prefix_special = this.getCurrentPrefix(); + var $tab_id = this.queryTabRegistry('prefix', $prefix_special, 'tab_id'); - if (isset($event)) set_hidden_field('events['+$prefix_special+']', $event); + $form_name = $tab_id + '_form'; // set firstly, because set_hidden_field uses it + if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event); if (isset($t)) set_hidden_field('t', $t); - this.submit_kernel_form($form_name, $result_div); + this.submit_kernel_form($form_name, $tab_id + '_div'); } @@ -170,4 +171,15 @@ Catalog.prototype.setItemCount = function($prefix, $count) { setInnerHTML($prefix + '_item_count', $count); +} + +Catalog.prototype.getCurrentPrefix = function() { + if (isset(Grids[this.ActivePrefix]) && (Grids[this.ActivePrefix].SelectedCount > 0)) { + // item tab grid exists and some items are selected + return this.ActivePrefix; + } + else { + // return prefix of first registred tab -> categories + return this.TabRegistry[0]['prefix']; + } } \ No newline at end of file