mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-16 18:14:23 +01:00
Added minification-safe boilerplate to the focus service.
This commit is contained in:
parent
240bfb78b6
commit
2253f51be7
1 changed files with 2 additions and 1 deletions
|
@ -19,8 +19,9 @@
|
|||
# using a jQuery selector.
|
||||
#
|
||||
# Based on: https://stackoverflow.com/a/25597540/3225811
|
||||
angular.module('ponyfm').factory 'focus', ($timeout, $window) ->
|
||||
angular.module('ponyfm').factory('focus', ['$timeout', '$window', ($timeout, $window) ->
|
||||
(selector) ->
|
||||
$timeout () ->
|
||||
element = $window.jQuery("#{selector}")
|
||||
element.focus() # will do nothing if the selector doesn't select anything
|
||||
])
|
||||
|
|
Loading…
Reference in a new issue