Index: admin_templates/js/toolbar.js =================================================================== --- admin_templates/js/toolbar.js (revision 13400) +++ admin_templates/js/toolbar.js (working copy) @@ -35,6 +35,9 @@ this.ToolBar = null; this.Prefix = prefix ? prefix : ''; this.Separator = false; + + // all buttons are read-only until page is fully loaded! + this.ReadOnly = true; } ToolBarButton.prototype.CheckTitleModule = function() @@ -93,10 +96,6 @@ this.SetOnClick(); this.SetOnRightClick() if (this.Hidden) this.Hide(); - - // all buttons are disabled until page is fully loaded! - this.Disable(); - if (!img.complete) { var real_path = img_path.replace('#MODULE#', this.Module) + 'toolbar/'; var old_path = img_path.replace('#MODULE#', 'kernel') + 'toolbar/'+this.ToolBar.IconPrefix + this.Title+'.gif'; @@ -111,7 +110,7 @@ } ToolBarButton.prototype.EditTitle = function() { - if (this.TranslateLink !== false) { + if (this.TranslateLink !== false && !this.ReadOnly) { var $links = this.TranslateLink; $links = $links.split('::'); @@ -159,19 +158,23 @@ /*this.Container.onmouseout = function() { this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif'; };*/ + this.Container.inClick = false; if (typeof(this.onClick) != 'function') { this.Container.onclick = function() { - if (this.inClick) return; + if (this.inClick || this.btn.ReadOnly) return; this.inClick = true; - if (eval('typeof('+this.btn.Title+')') == 'function') + + if (eval('typeof('+this.btn.Title+')') == 'function') { eval(this.btn.Title + '()'); + } + this.inClick = false; } } else { this.Container.onclick = function() { - if (this.inClick) return; + if (this.inClick || this.btn.ReadOnly) return; this.inClick = true; this.btn.onClick(); this.inClick = false; @@ -352,7 +355,7 @@ $(document).ready( function () { for (var $button_name in $me.Buttons) { - $me.Buttons[$button_name].Enable(); + $me.Buttons[$button_name].ReadOnly = false; } } );