- $(document).on('ajax:complete ready', function() {
- var a = $('.event-listener');
- if (a.length > 0) {
- $('.event-listener').each(function() {
- subscribeToEventLog(this.id);
- });
- }
+$(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){
+ var wasatbottom = ($(this).scrollTop() + $(this).height() >=
+ this.scrollHeight);
+ var parsedData = JSON.parse(eventData);
+ var propertyText = undefined;
+ var properties = parsedData.properties;
+
+ if (properties !== null) {
+ propertyText = properties.text;
+ }
+ if (propertyText !== undefined) {
+ $(this).append(propertyText + "<br/>");
+ } else {
+ $(this).append(parsedData.summary + "<br/>");
+ }
+ if (wasatbottom)
+ this.scrollTop = this.scrollHeight;
+}).on('ready ajax:complete', function(){
+ $('.arv-log-event-handler-append-logs').each(function() {
+ this.scrollTop = this.scrollHeight;