Index: trunk/core/admin_templates/js/toolbar.js =================================================================== diff -u -N -r7635 -r7855 --- trunk/core/admin_templates/js/toolbar.js (.../toolbar.js) (revision 7635) +++ trunk/core/admin_templates/js/toolbar.js (.../toolbar.js) (revision 7855) @@ -63,7 +63,7 @@ ToolBarButton.prototype.GetHTML = function() { var add_style = this.ToolBar.ButtonStyle ? 'style="'+this.ToolBar.ButtonStyle+'"' : ''; var o = '
' - o += ''; + o += ''; if (this.ToolBar.UseLabels) o += '
'+this.Label; o += '
' return o; @@ -81,6 +81,12 @@ this.Container = document.getElementById(this.GetToolID('div')) ? document.getElementById(this.GetToolID('div')) : false; this.Container.btn = this; img.btn = this; + + this.MouseOverImg = new Image(); + this.MouseOverImg.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f2.gif'; + this.MouseOutImg = new Image(); + this.MouseOutImg.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif'; + this.SetOnMouseOver(); this.SetOnMouseOut(); this.SetOnClick(); @@ -132,14 +138,14 @@ ToolBarButton.prototype.SetOnMouseOver = function() { this.Container.onmouseover = function() { - this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '_f2.gif'; + this.btn.imgObject.src = this.btn.MouseOverImg.src; this.className = 'toolbar-button-over'; }; } ToolBarButton.prototype.SetOnMouseOut = function() { this.Container.onmouseout = function() { - this.btn.imgObject.src = this.btn.IconsPath() + this.btn.ToolBar.IconPrefix + this.btn.Title + '.gif'; + this.btn.imgObject.src = this.btn.MouseOutImg.src; this.className = 'toolbar-button'; }; } @@ -188,7 +194,12 @@ ToolBarButton.prototype.Disable = function() { if ( !this.Enabled ) return; - this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif'; + + if (typeof(this.DisabledImg) == 'undefined') { + this.DisabledImg = new Image(); + this.DisabledImg.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '_f3.gif'; + } + this.imgObject.src = this.DisabledImg.src; this.Container.onmouseover = null; this.Container.onmouseout = null; this.Container.onclick = null; @@ -199,7 +210,7 @@ ToolBarButton.prototype.Enable = function() { if (this.Enabled) return; - this.imgObject.src = this.IconsPath() + this.ToolBar.IconPrefix + this.Title + '.gif'; + this.imgObject.src = this.MouseOutImg.src; this.SetOnMouseOver(); this.SetOnMouseOut(); this.SetOnClick(); @@ -268,6 +279,7 @@ { this.Module = $module ? $module : 'core'; this.IconPrefix = icon_prefix ? icon_prefix : 'tool_'; + this.IconSize = {w:32,h:32}; this.Buttons = new Array(); this.UseLabels = typeof($use_toolbarlabels) != 'undefined' ? $use_toolbarlabels : false; }