Fix firebug console detection
authorMichael M Slusarz <slusarz@curecanti.org>
Thu, 8 Oct 2009 22:00:43 +0000 (16:00 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Thu, 8 Oct 2009 22:00:43 +0000 (16:00 -0600)
imp/js/DimpCore.js

index 5bd4e28..11d9cdc 100644 (file)
@@ -26,9 +26,9 @@ var DimpCore = {
     debug: function(label, e)
     {
         if (!this.is_logout && DIMP.conf.debug) {
-            if (console && console.error) {
+            if (window.console && window.console.error) {
                 // Firebug error reporting.
-                console.error(label, e);
+                window.console.error(label, e);
             } else {
                 alert(label + ': ' + ((e instanceof Error && e.name && e.message) ? e.name + '-' + e.message : Object.inspect(e)) + (e.lineNumber ? ' (Line #' + e.lineNumber + ')' : ''));
             }