Index: trunk/core/admin_templates/js/catalog.js
===================================================================
diff -u -r5036 -r5047
--- trunk/core/admin_templates/js/catalog.js (.../catalog.js) (revision 5036)
+++ trunk/core/admin_templates/js/catalog.js (.../catalog.js) (revision 5047)
@@ -2,7 +2,7 @@
function Catalog($url_mask, $cookie_prefix) {
this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
- this.BusyRequest = false;
+ this.BusyRequest = new Array();
this.URLMask = $url_mask;
this.Separator = '#separator#';
this.ParentCategoryID = 0;
@@ -42,13 +42,15 @@
}
}
-Catalog.prototype.submit_kernel_form = function($form_name, $result_div) {
+Catalog.prototype.submit_kernel_form = function($tab_id) {
+ var $prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
var $kf = document.getElementById($form_name);
Request.params = Request.serializeForm($kf);
Request.method = $kf.method.toUpperCase();
- Request.makeRequest($kf.action, this.BusyRequest, $result_div, this.successCallback, this.errorCallback, $result_div);
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($kf.action, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div');
};
Catalog.prototype.successCallback = function($request, $params) {
@@ -94,7 +96,7 @@
if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
if (isset($t)) set_hidden_field('t', $t);
- this.submit_kernel_form($form_name, $tab_id + '_div');
+ this.submit_kernel_form($tab_id);
}
@@ -124,14 +126,22 @@
// 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');
+
+ var $prefix = this.TabRegistry[0]['prefix'];
+ 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.switchTab(); // refresh current item tab
}
Catalog.prototype.switchTab = function($prefix) {
if (!isset($prefix)) $prefix = this.ActivePrefix;
+ if (this.BusyRequest[$prefix]) {
+ alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
+ }
+
if (this.ActivePrefix != $prefix) {
// hide source tab
this.PreviousPrefix = this.ActivePrefix;
@@ -156,7 +166,9 @@
var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/catalog_tab');
$url = $url.replace('#CATEGORY_ID#', $cat_id);
- Request.makeRequest($url, this.BusyRequest, $div_id, this.successCallback, this.errorCallback, $div_id);
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id);
+// $Debugger.ShowProps(this.BusyRequest);
}
/*else {
alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'}');
Index: trunk/kernel/admin_templates/incs/catalog.js
===================================================================
diff -u -r5036 -r5047
--- trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5036)
+++ trunk/kernel/admin_templates/incs/catalog.js (.../catalog.js) (revision 5047)
@@ -2,7 +2,7 @@
function Catalog($url_mask, $cookie_prefix) {
this.CookiePrefix = $cookie_prefix ? $cookie_prefix : '';
- this.BusyRequest = false;
+ this.BusyRequest = new Array();
this.URLMask = $url_mask;
this.Separator = '#separator#';
this.ParentCategoryID = 0;
@@ -42,13 +42,15 @@
}
}
-Catalog.prototype.submit_kernel_form = function($form_name, $result_div) {
+Catalog.prototype.submit_kernel_form = function($tab_id) {
+ var $prefix = this.queryTabRegistry('tab_id', $tab_id, 'prefix');
var $kf = document.getElementById($form_name);
Request.params = Request.serializeForm($kf);
Request.method = $kf.method.toUpperCase();
- Request.makeRequest($kf.action, this.BusyRequest, $result_div, this.successCallback, this.errorCallback, $result_div);
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($kf.action, this.BusyRequest[$prefix], $tab_id + '_div', this.successCallback, this.errorCallback, $tab_id + '_div');
};
Catalog.prototype.successCallback = function($request, $params) {
@@ -94,7 +96,7 @@
if (isset($event)) set_hidden_field('events[' + $prefix_special + ']', $event);
if (isset($t)) set_hidden_field('t', $t);
- this.submit_kernel_form($form_name, $tab_id + '_div');
+ this.submit_kernel_form($tab_id);
}
@@ -124,14 +126,22 @@
// 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');
+
+ var $prefix = this.TabRegistry[0]['prefix'];
+ 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.switchTab(); // refresh current item tab
}
Catalog.prototype.switchTab = function($prefix) {
if (!isset($prefix)) $prefix = this.ActivePrefix;
+ if (this.BusyRequest[$prefix]) {
+ alert('prefix: ['+$prefix+']; request busy: ['+this.BusyRequest[$prefix]+']');
+ }
+
if (this.ActivePrefix != $prefix) {
// hide source tab
this.PreviousPrefix = this.ActivePrefix;
@@ -156,7 +166,9 @@
var $url = this.URLMask.replace('#TEMPLATE_NAME#', this.queryTabRegistry('prefix', $prefix, 'module_path') + '/catalog_tab');
$url = $url.replace('#CATEGORY_ID#', $cat_id);
- Request.makeRequest($url, this.BusyRequest, $div_id, this.successCallback, this.errorCallback, $div_id);
+ this.BusyRequest[$prefix] = false;
+ Request.makeRequest($url, this.BusyRequest[$prefix], $div_id, this.successCallback, this.errorCallback, $div_id);
+// $Debugger.ShowProps(this.BusyRequest);
}
/*else {
alert('refresh disabled = {tab: '+this.ActivePrefix+'; cat_id: '+$cat_id+'}');
Index: trunk/kernel/admin_templates/incs/grid_blocks.tpl
===================================================================
diff -u -r5044 -r5047
--- trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 5044)
+++ trunk/kernel/admin_templates/incs/grid_blocks.tpl (.../grid_blocks.tpl) (revision 5047)
@@ -324,7 +324,7 @@
$ViewMenus = new Array('