{"_id":"lr-sticky-header","_rev":"4-afba5b43bef5ff0b1eadd16d2e8296cb","name":"lr-sticky-header","description":"make table header sticky","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"lr-sticky-header","version":"1.0.0","description":"make table header sticky","main":"lrStickyHeader.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/lorenzofox3/lrStickyHeader.git"},"keywords":["table","sticky","header"],"author":{"name":"laurent renard"},"license":"MIT","bugs":{"url":"https://github.com/lorenzofox3/lrStickyHeader/issues"},"homepage":"https://github.com/lorenzofox3/lrStickyHeader#readme","gitHead":"83c60b79b060142167799c74a4b8c01d7a5eb155","_id":"lr-sticky-header@1.0.0","_shasum":"8f316c299020ed6cbcf455398170683a8f8ef3ae","_from":".","_npmVersion":"2.13.2","_nodeVersion":"0.12.7","_npmUser":{"name":"lorenzofox3","email":"laurent34azerty@gmail.com"},"maintainers":[{"name":"lorenzofox3","email":"laurent34azerty@gmail.com"}],"dist":{"shasum":"8f316c299020ed6cbcf455398170683a8f8ef3ae","tarball":"https://registry.npmjs.org/lr-sticky-header/-/lr-sticky-header-1.0.0.tgz","integrity":"sha512-4iVo7MYoej88ra81ZlSrwHATCjCMEfdHNgaw+AFvoZolL7AcfcaYhc3mh7DOW4nOt43WxWhg3gYAf9fuB9usVg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH9wNE8hUXmApqZ2o5vwrHCPGxpTO8ufQEzroiDrlu6nAiEA8zQjleQ/dE2hVZH2XhL/B7qmATAsPSZ070zqxpMVXAk="}]}},"1.1.0":{"name":"lr-sticky-header","version":"1.1.0","description":"make table header sticky","main":"lrStickyHeader.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/lorenzofox3/lrStickyHeader.git"},"keywords":["table","sticky","header"],"author":{"name":"laurent renard"},"license":"MIT","bugs":{"url":"https://github.com/lorenzofox3/lrStickyHeader/issues"},"homepage":"https://github.com/lorenzofox3/lrStickyHeader#readme","gitHead":"e3deb2c89841362781ddbcbda141d0ab682f9aa7","_id":"lr-sticky-header@1.1.0","_shasum":"f01db390e860df558841c32792cd364b664fbd8d","_from":".","_npmVersion":"2.14.7","_nodeVersion":"4.2.3","_npmUser":{"name":"lorenzofox3","email":"laurent34azerty@gmail.com"},"dist":{"shasum":"f01db390e860df558841c32792cd364b664fbd8d","tarball":"https://registry.npmjs.org/lr-sticky-header/-/lr-sticky-header-1.1.0.tgz","integrity":"sha512-Onj7eHJ+baJcQL9PHt3+0dfEjTesxjW6D48wW5NAGwsJmmLIZxDfYYvJgO0Yv+mxJZ2dJ2lthl2g/tlXM4rflA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD38WDJEZdKgjjq3rWNZlMgM+2fyN3vxnPWZu4uWWNMTgIhALrGvCnxaUaVcXosNTehOE1Tb/uzDpC/wGv6Lgf3ZgVv"}]},"maintainers":[{"name":"lorenzofox3","email":"laurent34azerty@gmail.com"}]}},"readme":"# lrStickyHeader\n\nmake table headers sticky, example for [React CRM](http://reactcrm.com/)\n\n![stStickeyHeader](http://i.imgur.com/ocN250H.gif)\n\n[live demo](http://lorenzofox3.github.io/lrStickyHeader/example.html)\n\n* (almost)no css to add \n* no dependency\n* does not add any other element to the markup\n* ~ 100 loc\n\n## install \n\n``bower install lr-sticky-header``\n\n``npm install lr-sticky-header``\n\n## dependencies \n\nNone\n\n## usage\n\n```Javascript\nvar tableElement = document.getElementById('table');\n\nvar stickyTable = lrStickyHeader(tableElement);\n```\n\n### style\n\nYou'll need your table element and its children to have the property ``box-sizing`` set to ``border-box`` (it is the default of many css framework such bootstrap\n\nwhen the header is sticked the class name ``lr-sticky-header`` is added to the thead element if you want to add some more style\n\n### api\n\n*  **setWidth()** : if you want to call manually the resize of the column (within a resize event handler for example)\n*  **clean()** ~: to detach the scroll event handler from the window\n\n### example of a directive with [smart-table](http://lorenzofox3.github.io/smart-table-website/)\n\n```javascript\n  angular.directive('stStickyHeader', ['$window', function ($window) {\n    return {\n      require: '^?stTable',\n      link: function (scope, element, attr, ctrl) {\n        var stickyHeader = lrStickyHeader(element[0]);\n        scope.$on('$destroy', function () {\n          stickyHeader.clean();\n        });\n\n        scope.$watch(function () {\n          return ctrl.tableState();\n        }, function () {\n          $window.scrollTo(0, lrStickyHeader.treshold);\n        }, true)\n      }\n    }\n  }]);\n```\n\n\n\n\n","maintainers":[{"name":"lorenzofox3","email":"laurent34azerty@gmail.com"}],"time":{"modified":"2022-06-19T14:28:56.876Z","created":"2015-09-14T07:08:37.296Z","1.0.0":"2015-09-14T07:08:37.296Z","1.1.0":"2016-01-06T13:44:48.277Z"},"homepage":"https://github.com/lorenzofox3/lrStickyHeader#readme","keywords":["table","sticky","header"],"repository":{"type":"git","url":"git+https://github.com/lorenzofox3/lrStickyHeader.git"},"author":{"name":"laurent renard"},"bugs":{"url":"https://github.com/lorenzofox3/lrStickyHeader/issues"},"license":"MIT","readmeFilename":"README.md"}