Posted by jhm on July 18, 2008 at 1:30am
| Project: | Firebug |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
When display icon for firebug is selected, a nice little floating image is displayed in the top right corner of the browser. Alas, when submitting any of the settings forms, the image breaks.
Turns out that drupal_add_js(...,'setting') is called multiple times, effectively turning Drupal.settings.firebug.path from string into object breaking the img src
the following change to firebug_controls.js fixes that (check typeof Drupal.settings.firebug.path)
if (Drupal.jsEnabled) {
$(document).ready(function() {
if (Drupal.settings.firebug.icon && !console.firebug) {
var path = typeof Drupal.settings.firebug.path == 'object' ? Drupal.settings.firebug.path[0] : Drupal.settings.firebug.path;
var link = $('<a href="#firebug" title="Firebug"><img src="'+ path +'/firebug/firebug3.jpg" alt="Firebug" /><a>').click(firebug.toggle);
$('<div id="firebug_icon"></div>').css({position: 'fixed', top: '5px', right: '10px'}).append(link).prependTo(document.body);
}
});
}