From 043cacfc2617222dc4a6fa53d8b24a20cfb198af Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Tue, 18 Apr 2017 19:52:00 +0200 Subject: [PATCH] Implemented issue #205 - Cursor focus on any modal dialogs. --- .../app/controllers/_application_controller.coffee | 4 ++-- .../app/controllers/ticket_zoom/time_accounting.coffee | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/app/controllers/_application_controller.coffee b/app/assets/javascripts/app/controllers/_application_controller.coffee index f973d0e79..8c5b09f6e 100644 --- a/app/assets/javascripts/app/controllers/_application_controller.coffee +++ b/app/assets/javascripts/app/controllers/_application_controller.coffee @@ -793,8 +793,8 @@ class App.ControllerModal extends App.Controller onShow: -> # do nothing - onShown: -> - # do nothing + onShown: => + @$('input:not([disabled]):not([type="hidden"]):not(".btn"), textarea').first().focus() onClose: -> # do nothing diff --git a/app/assets/javascripts/app/controllers/ticket_zoom/time_accounting.coffee b/app/assets/javascripts/app/controllers/ticket_zoom/time_accounting.coffee index 87f1307bb..8c4c01546 100644 --- a/app/assets/javascripts/app/controllers/ticket_zoom/time_accounting.coffee +++ b/app/assets/javascripts/app/controllers/ticket_zoom/time_accounting.coffee @@ -20,9 +20,6 @@ class App.TicketZoomTimeAccounting extends App.ControllerModal content: -> App.view('ticket_zoom/time_accounting')() - onShown: => - @$('[name="time_unit"]').focus() - skip: (e) => return if !@submitCallback @submitCallback({})