From 4a123b7a75d6cd25fc9286eb16e2a2e7ddb7b7c8 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Wed, 29 Oct 2014 23:34:49 +0100 Subject: [PATCH] ticket zoom: auto-scroll to bottom when rendering --- .../javascripts/app/controllers/ticket_zoom.js.coffee | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee index 306cca368..d9717a42c 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom.js.coffee @@ -1,4 +1,7 @@ class App.TicketZoom extends App.Controller + elements: + '.main': 'main' + events: 'click .js-submit': 'submit' @@ -385,6 +388,11 @@ class App.TicketZoom extends App.Controller @bindScrollPageHeader() + @scrollToBottom() + + scrollToBottom: -> + @main.scrollTop( @main.prop('scrollHeight') ) + bindScrollPageHeader: -> pageHeader = @$('.page-header') scrollHolder = pageHeader.scrollParent()