Bug fixes / enhancements to modal (autofocus issue and opened promise is...

...sue)

1) Auto-focusing of a freshly-opened modal element causes any child elements with the autofocus attribute to loose focus. This is an issue on touch based devices which will show and then hide the onscreen keyboard. Attempts to refocus the autofocus element via JavaScript will not reopen the onscreen keyboard. Fixed by updated the focusing logic to only autofocus the modal element if the modal does not contain an autofocus element.

2) Added $modalStack.get(modalInstance) method, which is used by the next fix.

3) Moved the modalOpenedDeferred to a transition end event (when available) so that the opened promise doesn't get resolved until the modal is in the DOM and visible / accessible.

Signed-off-by: Michael Lilli <mlilli@innov8ia.com>