 
 KanbanDirective = ($repo, $rootscope) ->
     link = ($scope, $el, $attrs) ->
-
         tableBodyDom = $el.find(".kanban-table-body")
+
         tableBodyDom.on "scroll", (event) ->
             target = angular.element(event.currentTarget)
             tableHeaderDom = $el.find(".kanban-table-header .kanban-table-inner")
             tableHeaderDom.css("left", -1 * target.scrollLeft())
+
+        $scope.$on "$destroy", ->
+            $el.off()
 
     return {link: link}
 

        $scope.$on "kanban:us:move", redrawWipLimit
        $scope.$on "usform:new:success", redrawWipLimit
        $scope.$on "usform:bulk:success", redrawWipLimit

    return {link: link}


            size = (statuses.length * itemSize) - 10
            $el.css("width", "#{size}px")

        $scope.$on "$destroy", ->
            $el.off()

    return {link: link}

module.directive("tgKanbanRowWidthFixer", KanbanRowWidthFixerDirective)


#############################################################################
## Kanban Column Height Fixer Directive
