James Moger
2014-06-13 7fb8d1209a3926329638fc3ca5f0b4bc428029f6
Catch flotr2 exceptions, otherwise downstream AngularJS doesn't execute
1 files modified
8 ■■■■ changed files
src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java 8 ●●●● patch | view | raw | blame | history
src/main/java/com/gitblit/wicket/charting/Flotr2Charts.java
@@ -45,11 +45,17 @@
        StringBuilder sb = new StringBuilder();
        
        line(sb, "$( document ).ready(function() {");
        line(sb, "try {");
        // add charts to header
        for (Chart chart : charts) {
            chart.appendChart(sb);
        }
        line(sb, "} catch (exception) {");
        line(sb, "  if (window.console && window.console.log) {");
        line(sb, "    window.console.log('flotr2 exception');");
        line(sb, "    window.console.log(exception);");
        line(sb, "  }");
        line(sb, "}");
        // end draw chart function
        line(sb, "});");
        response.renderJavascript(sb.toString(), null);