Commit 7c83d877 authored by Randall Leeds's avatar Randall Leeds

angular directives module with navTabs directive

Add a directives module. For now it has one directive, 'navTabs',
which automatically focuses the first input element when switching
tabs.
parent 3d80f2ed
navTabsDirective = (deform) ->
link: (scope, iElement, iAttrs, controller) ->
iElement.find('a')
# Focus the first form element when showing a tab pane
.on 'shown', (e) ->
target = $(e.target).data('target')
deform.focusFirstInput(target)
# Always show the first pane to start
.first().tab('show')
restrict: 'C'
navTabsDirective.$inject = ['deform']
angular.module('h.directives', ['deform'])
.directive('navTabs', navTabsDirective)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment