Browse Source

Implemented issue #205 - Cursor focus on any modal dialogs.

Martin Edenhofer 8 years ago
parent
commit
043cacfc26

+ 2 - 2
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

+ 0 - 3
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({})