angular-sticky-table-header
Advanced tools
Comparing version
{ | ||
"name": "angular-sticky-table-header", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Sticky headers for tables", | ||
@@ -5,0 +5,0 @@ "main": "dist/angular-sticky-table-header.js", |
@@ -103,2 +103,8 @@ angular.module('watchDom', []).constant('watchDomOptions', { | ||
scope.mutationObserver = watchDom.$watch(scope.tr, _.throttle(scope.resetClone, options.observeHeaderInterval), { subtree: true }); | ||
}, | ||
rowsChanged: function () { | ||
$timeout(function () { | ||
scope.checkScroll(); | ||
scope.setClonedCellWidths(); | ||
}); | ||
} | ||
@@ -110,3 +116,3 @@ }); | ||
return scope[attrs.rows]; | ||
}, $timeout.bind(null, scope.setClonedCellWidths)); | ||
}, scope.rowsChanged); | ||
} | ||
@@ -113,0 +119,0 @@ // fired when stuck state changes |
{ | ||
"name": "angular-sticky-table-header", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "Sticky headers for tables", | ||
@@ -5,0 +5,0 @@ "main": "dist/angular-sticky-table-header.js", |
@@ -140,2 +140,11 @@ angular | ||
}, | ||
rowsChanged: function () { | ||
$timeout(function(){ | ||
scope.checkScroll(); | ||
scope.setClonedCellWidths(); | ||
}); | ||
} | ||
@@ -149,3 +158,3 @@ | ||
return scope[attrs.rows]; | ||
}, $timeout.bind(null, scope.setClonedCellWidths)); | ||
}, scope.rowsChanged); | ||
} | ||
@@ -152,0 +161,0 @@ |
@@ -37,3 +37,3 @@ // Generated by CoffeeScript 1.7.1 | ||
}); | ||
_this.element = angular.element("<div sticky-table-header columns=\"columnCollection\" rows=\"rowCollection\">\n\n <table class=\"table\">\n <thead>\n <tr>\n <th ng-repeat=\"th in columnCollection\">{{th}}</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat=\"tr in rowCollection\">\n <td ng-repeat=\"td in tr\">{{td}}</td>\n </tr>\n </tbody>\n </table>\n\n</div>"); | ||
_this.element = angular.element("<div sticky-table-header rows=\"rowCollection\">\n\n <table class=\"table\">\n <thead>\n <tr>\n <th ng-repeat=\"th in columnCollection\">{{th}}</th>\n </tr>\n </thead>\n <tbody>\n <tr ng-repeat=\"tr in rowCollection\">\n <td ng-repeat=\"td in tr\">{{td}}</td>\n </tr>\n </tbody>\n </table>\n\n</div>"); | ||
($compile(_this.element))(_this.scope); | ||
@@ -248,2 +248,12 @@ _this.scope.$digest(); | ||
}); | ||
describe('#rowsChanged', function() { | ||
return it('should call #checkScroll and #setClonedCellWidths after a $timeout', inject(function($timeout) { | ||
spyOn(this.scope, 'checkScroll'); | ||
spyOn(this.scope, 'setClonedCellWidths'); | ||
this.scope.rowsChanged(); | ||
$timeout.flush(); | ||
expect(this.scope.checkScroll).toHaveBeenCalled(); | ||
return expect(this.scope.setClonedCellWidths).toHaveBeenCalled(); | ||
})); | ||
}); | ||
return describe('$destroy', function() { | ||
@@ -250,0 +260,0 @@ return it('should remove the mutation observer', function() { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
45400
2.33%573
3.99%