Merge "Adds javascript console logging for debug mode."
This commit is contained in:
commit
401be66e81
@ -44,9 +44,7 @@ horizon.datatables = {
|
||||
$table.trigger("update");
|
||||
break;
|
||||
default:
|
||||
if (horizon.conf.debug) {
|
||||
horizon.alert("error", gettext("An error occurred while updating."));
|
||||
}
|
||||
horizon.utils.log(gettext("An error occurred while updating."));
|
||||
$row.removeClass("ajax-update");
|
||||
$row.find("i.ajax-updating").remove();
|
||||
break;
|
||||
|
@ -1,5 +1,12 @@
|
||||
/* Utilities for common needs which aren't JS builtins. */
|
||||
horizon.utils = {
|
||||
// Log function which checks for DEBUG and the existence of a console.
|
||||
log: function (thing_to_log) {
|
||||
if (horizon.conf.debug && typeof(console) !== "undefined" && typeof(console.log) !== "undefined") {
|
||||
console.log(thing_to_log);
|
||||
}
|
||||
},
|
||||
|
||||
capitalize: function(string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user