@@ -39,7 +39,7 @@ angular.module('$strap.directives')
3939 } ) ;
4040
4141 // Provide scope display functions
42- scope . _modal = function ( name ) {
42+ scope . $modal = function ( name ) {
4343 $modal . modal ( name ) ;
4444 } ;
4545 scope . hide = function ( ) {
@@ -50,20 +50,18 @@ angular.module('$strap.directives')
5050 } ;
5151 scope . dismiss = scope . hide ;
5252
53- $modal . on ( " show" , function ( event ) {
54- scope . $emit ( " modal-show" , event ) ;
53+ $modal . on ( ' show' , function ( event ) {
54+ scope . $emit ( ' modal-show' , event ) ;
5555 } ) ;
56-
57- $modal . on ( " shown" , function ( event ) {
58- scope . $emit ( "modal-shown" , event ) ;
56+ $modal . on ( 'shown' , function ( event ) {
57+ scope . $emit ( 'modal- shown' , event ) ;
58+ $ ( 'input[autofocus]' ) . first ( ) . trigger ( 'focus' ) ;
5959 } ) ;
60-
61- $modal . on ( "hide" , function ( event ) {
62- scope . $emit ( "modal-hide" , event ) ;
60+ $modal . on ( 'hide' , function ( event ) {
61+ scope . $emit ( 'modal-hide' , event ) ;
6362 } ) ;
64-
65- $modal . on ( "hidden" , function ( event ) {
66- scope . $emit ( "modal-hidden" , event ) ;
63+ $modal . on ( 'hidden' , function ( event ) {
64+ scope . $emit ( 'modal-hidden' , event ) ;
6765 } ) ;
6866
6967 } ) ;
0 commit comments