Skip to content

Commit

Permalink
Merge pull request twbs#46 from abaran/table-header-insertion-fix
Browse files Browse the repository at this point in the history
insert table's header before table's body
  • Loading branch information
esvit committed Jul 24, 2013
2 parents 91af6e7 + ee132b9 commit d6ccec0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/scripts/directive.coffee
Expand Up @@ -163,6 +163,8 @@ angular.module("ngTable", []).directive("ngTable", ["$compile", "$q", "$parse",
headerTemplate = $compile("<thead ng-include=\"templates.header\"></thead>")(scope)
paginationTemplate = $compile("<div ng-include=\"templates.pagination\"></div>")(scope)
element.filter("thead").remove()
element.prepend(headerTemplate).addClass "ng-table"
tbody = element.find('tbody')
if (tbody[0]) then $(tbody[0]).before headerTemplate else element.prepend headerTemplate
element.addClass "ng-table"
element.after paginationTemplate
])

0 comments on commit d6ccec0

Please sign in to comment.