Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzofox3 committed Sep 14, 2015
0 parents commit 7dd6d07
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
.idea
bower_components
20 changes: 20 additions & 0 deletions bower.json
@@ -0,0 +1,20 @@
{
"name": "smart-table-sticky-header",
"version": "1.0.0",
"authors": [
"lorenzofox3 <laurent34azerty@gmail.com>"
],
"description": "sticky table header for smart-table",
"main": "stStickyHeader.js",
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests"
],
"dependencies": {
"lr-sticky-header": "~1.0.0"
}
}
11 changes: 11 additions & 0 deletions package.json
@@ -0,0 +1,11 @@
{
"name": "smart-table-sticky-header",
"version": "1.0.0",
"description": "sticky header directive for smart table",
"main": "stStickyHeader.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Laurent Renard",
"license": "MIT"
}
20 changes: 20 additions & 0 deletions stStickyHeader.js
@@ -0,0 +1,20 @@
(function (ng, undefined) {
'use strict';
ng.directive('stStickyHeader', ['$window', function ($window) {
return {
require: '^?stTable',
link: function (scope, element, attr, ctrl) {
var stickyHeader = lrStickyHeader(element[0]);
scope.$on('$destroy', function () {
stickyHeader.clean();
});

scope.$watch(function () {
return ctrl.tableState();
}, function () {
$window.scrollTo(0, lrStickyHeader.treshold);
}, true)
}
}
}]);
})(angular);

0 comments on commit 7dd6d07

Please sign in to comment.