| 18644 | var _instCounter = 0 |
| 18645 | |
| 18646 | var FixedHeader = function (dt, config) { |
| 18647 | if (!DataTable.versionCheck("2")) { |
| 18648 | throw "Warning: FixedHeader requires DataTables 2 or newer" |
| 18649 | } |
| 18650 | |
| 18651 | // Sanity check - you just know it will happen |
| 18652 | if (!(this instanceof FixedHeader)) { |
| 18653 | throw "FixedHeader must be initialised with the 'new' keyword." |
| 18654 | } |
| 18655 | |
| 18656 | // Allow a boolean true for defaults |
| 18657 | if (config === true) { |
| 18658 | config = {} |
| 18659 | } |
| 18660 | |
| 18661 | dt = new DataTable.Api(dt) |
| 18662 | |
| 18663 | this.c = $.extend(true, {}, FixedHeader.defaults, config) |
| 18664 | |
| 18665 | this.s = { |
| 18666 | dt: dt, |
| 18667 | position: { |
| 18668 | theadTop: 0, |
| 18669 | tbodyTop: 0, |
| 18670 | tfootTop: 0, |
| 18671 | tfootBottom: 0, |
| 18672 | width: 0, |
| 18673 | left: 0, |
| 18674 | tfootHeight: 0, |
| 18675 | theadHeight: 0, |
| 18676 | windowHeight: $(window).height(), |
| 18677 | visible: true |
| 18678 | }, |
| 18679 | headerMode: null, |
| 18680 | footerMode: null, |
| 18681 | autoWidth: dt.settings()[0].oFeatures.bAutoWidth, |
| 18682 | namespace: ".dtfc" + _instCounter++, |
| 18683 | scrollLeft: { |
| 18684 | header: -1, |
| 18685 | footer: -1 |
| 18686 | }, |
| 18687 | enable: true, |
| 18688 | autoDisable: false |
| 18689 | } |
| 18690 | |
| 18691 | this.dom = { |
| 18692 | floatingHeader: null, |
| 18693 | thead: $(dt.table().header()), |
| 18694 | tbody: $(dt.table().body()), |
| 18695 | tfoot: $(dt.table().footer()), |
| 18696 | header: { |
| 18697 | host: null, |
| 18698 | floating: null, |
| 18699 | floatingParent: $('<div class="dtfh-floatingparent"><div></div></div>'), |
| 18700 | placeholder: null |
| 18701 | }, |
| 18702 | footer: { |
| 18703 | host: null, |