Added minification-safe boilerplate to the focus service.

This commit is contained in:
Peter Deltchev 2015-10-29 03:57:50 -07:00
parent 240bfb78b6
commit 2253f51be7

View file

@ -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
])