This repository has been archived by the owner on Aug 22, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7dd6d07
Showing
4 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.idea | ||
bower_components |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); |