From bf6dfd5785f6767d2700dadfebb8591a8595d5f3 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Mon, 5 Sep 2016 16:23:48 -0400 Subject: [PATCH] 9679: Extricate container/job log code from pipeline-specific code. --- .../assets/javascripts/pipeline_instances.js | 20 ------------------- .../app/assets/javascripts/work_unit_log.js | 19 ++++++++++++++++++ 2 files changed, 19 insertions(+), 20 deletions(-) create mode 100644 apps/workbench/app/assets/javascripts/work_unit_log.js diff --git a/apps/workbench/app/assets/javascripts/pipeline_instances.js b/apps/workbench/app/assets/javascripts/pipeline_instances.js index 1617a92992..ec43747a08 100644 --- a/apps/workbench/app/assets/javascripts/pipeline_instances.js +++ b/apps/workbench/app/assets/javascripts/pipeline_instances.js @@ -101,26 +101,6 @@ $(document).on('ready ajax:success', function() { }); }); -$(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){ - if (this != event.target) { - // Not interested in events sent to child nodes. - return; - } - var wasatbottom = ($(this).scrollTop() + $(this).height() >= this.scrollHeight); - - if (eventData.properties != null && eventData.properties.text != null) { - if( eventData.prepend ) { - $(this).prepend(eventData.properties.text); - } else { - $(this).append(eventData.properties.text); - } - } - - if (wasatbottom) { - this.scrollTop = this.scrollHeight; - } -}); - // Set up all events for the pipeline instances compare button. (function() { var compare_form = '#compare'; diff --git a/apps/workbench/app/assets/javascripts/work_unit_log.js b/apps/workbench/app/assets/javascripts/work_unit_log.js new file mode 100644 index 0000000000..07606929c4 --- /dev/null +++ b/apps/workbench/app/assets/javascripts/work_unit_log.js @@ -0,0 +1,19 @@ +$(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){ + if (this != event.target) { + // Not interested in events sent to child nodes. + return; + } + var wasatbottom = ($(this).scrollTop() + $(this).height() >= this.scrollHeight); + + if (eventData.properties != null && eventData.properties.text != null) { + if( eventData.prepend ) { + $(this).prepend(eventData.properties.text); + } else { + $(this).append(eventData.properties.text); + } + } + + if (wasatbottom) { + this.scrollTop = this.scrollHeight; + } +}); -- 2.30.2