Skip to content

Commit

Permalink
Merge pull request #67 from mkoryak/bug-fixes
Browse files Browse the repository at this point in the history
bug fixes
  • Loading branch information
mkoryak committed Mar 24, 2014
2 parents 17d164a + 6d3bcd1 commit 259ffec
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 21 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
jquery.floatThead v1.2.4
jquery.floatThead v1.2.5
=================

Float the table header without special css. This plugin assumes nothing about your table markup and "just works" without losing your events or styles. Supports floating the header while scrolling within the window or while scrolling within a container with overflow.
Expand Down Expand Up @@ -84,6 +84,11 @@ Watch for it.

Change Log
----------
### 1.2.5
- bug fixes:
- https://github.com/mkoryak/floatThead/issues/66
- https://github.com/mkoryak/floatThead/issues/65
- https://github.com/mkoryak/floatThead/issues/62

### 1.2.4
- better support for really really wide tables
Expand Down
5 changes: 2 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jquery.floatThead",
"version": "1.2.4",
"version": "1.2.5",
"homepage": "http://mkoryak.github.io/floatThead/",
"authors": [
"Misha Koryak"
Expand All @@ -16,8 +16,7 @@
"node_modules",
"bower_components",
"test",
"demo",
"USED_BY.md"
"demo"
],
"dependencies": {
"jquery": ">= 1.9.0"
Expand Down
23 changes: 19 additions & 4 deletions dist/jquery.floatThead-slim.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @preserve jQuery.floatThead 1.2.4 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
// @preserve jQuery.floatThead 1.2.5 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
// @license Licensed under http://creativecommons.org/licenses/by-sa/4.0/

/* @author Misha Koryak
Expand Down Expand Up @@ -66,7 +66,19 @@
*/

function windowResize(debounceMs, cb){
$window.bind('resize.floatTHead', util.debounce(cb, debounceMs)); //TODO: check if resize bug is gone in IE8 +
if(ieVersion == 8){ //ie8 is crap: https://github.com/mkoryak/floatThead/issues/65
var winWidth = $window.width();
var debouncedCb = util.debounce(function(){
var winWidthNew = $window.width();
if(winWidth != winWidthNew){
winWidth = winWidthNew;
cb();
}
}, debounceMs);
$window.bind('resize.floatTHead', debouncedCb);
} else {
$window.bind('resize.floatTHead', util.debounce(cb, debounceMs));
}
}


Expand Down Expand Up @@ -144,7 +156,7 @@
}
var opts = $.extend({}, $.floatThead.defaults || {}, map);

$.each(map, function(val, key){
$.each(map, function(key, val){
if((!(key in $.floatThead.defaults)) && opts.debug){
debug("jQuery.floatThead: used ["+key+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+ (util.keys($.floatThead.defaults)).join(', '));
}
Expand Down Expand Up @@ -256,7 +268,10 @@
var originalTableWidth = $table[0].style.width || "auto";

function setHeaderHeight(){
var headerHeight = $header.find(opts.cellTag).outerHeight(true);
var headerHeight = 0;
$header.find("tr").each(function(){
headerHeight += $(this).outerHeight(true);
});
$sizerRow.outerHeight(headerHeight);
$sizerCells.outerHeight(headerHeight);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.floatThead-slim.min.js

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions dist/jquery.floatThead.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @preserve jQuery.floatThead 1.2.4 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
// @preserve jQuery.floatThead 1.2.5 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
// @license Licensed under http://creativecommons.org/licenses/by-sa/4.0/

/* @author Misha Koryak
Expand Down Expand Up @@ -66,7 +66,19 @@
*/

function windowResize(debounceMs, cb){
$window.bind('resize.floatTHead', util.debounce(cb, debounceMs)); //TODO: check if resize bug is gone in IE8 +
if(ieVersion == 8){ //ie8 is crap: https://github.com/mkoryak/floatThead/issues/65
var winWidth = $window.width();
var debouncedCb = util.debounce(function(){
var winWidthNew = $window.width();
if(winWidth != winWidthNew){
winWidth = winWidthNew;
cb();
}
}, debounceMs);
$window.bind('resize.floatTHead', debouncedCb);
} else {
$window.bind('resize.floatTHead', util.debounce(cb, debounceMs));
}
}


Expand Down Expand Up @@ -144,7 +156,7 @@
}
var opts = $.extend({}, $.floatThead.defaults || {}, map);

$.each(map, function(val, key){
$.each(map, function(key, val){
if((!(key in $.floatThead.defaults)) && opts.debug){
debug("jQuery.floatThead: used ["+key+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+ (util.keys($.floatThead.defaults)).join(', '));
}
Expand Down Expand Up @@ -256,7 +268,10 @@
var originalTableWidth = $table[0].style.width || "auto";

function setHeaderHeight(){
var headerHeight = $header.find(opts.cellTag).outerHeight(true);
var headerHeight = 0;
$header.find("tr").each(function(){
headerHeight += $(this).outerHeight(true);
});
$sizerRow.outerHeight(headerHeight);
$sizerCells.outerHeight(headerHeight);
}
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.floatThead.min.js

Large diffs are not rendered by default.

23 changes: 19 additions & 4 deletions jquery.floatThead.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @preserve jQuery.floatThead 1.2.4 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
// @preserve jQuery.floatThead 1.2.5 - http://mkoryak.github.io/floatThead/ - Copyright (c) 2012 - 2014 Misha Koryak
// @license Licensed under http://creativecommons.org/licenses/by-sa/4.0/

/* @author Misha Koryak
Expand Down Expand Up @@ -66,7 +66,19 @@
*/

function windowResize(debounceMs, cb){
$window.bind('resize.floatTHead', util.debounce(cb, debounceMs)); //TODO: check if resize bug is gone in IE8 +
if(ieVersion == 8){ //ie8 is crap: https://github.com/mkoryak/floatThead/issues/65
var winWidth = $window.width();
var debouncedCb = util.debounce(function(){
var winWidthNew = $window.width();
if(winWidth != winWidthNew){
winWidth = winWidthNew;
cb();
}
}, debounceMs);
$window.bind('resize.floatTHead', debouncedCb);
} else {
$window.bind('resize.floatTHead', util.debounce(cb, debounceMs));
}
}


Expand Down Expand Up @@ -144,7 +156,7 @@
}
var opts = $.extend({}, $.floatThead.defaults || {}, map);

$.each(map, function(val, key){
$.each(map, function(key, val){
if((!(key in $.floatThead.defaults)) && opts.debug){
debug("jQuery.floatThead: used ["+key+"] key to init plugin, but that param is not an option for the plugin. Valid options are: "+ (util.keys($.floatThead.defaults)).join(', '));
}
Expand Down Expand Up @@ -256,7 +268,10 @@
var originalTableWidth = $table[0].style.width || "auto";

function setHeaderHeight(){
var headerHeight = $header.find(opts.cellTag).outerHeight(true);
var headerHeight = 0;
$header.find("tr").each(function(){
headerHeight += $(this).outerHeight(true);
});
$sizerRow.outerHeight(headerHeight);
$sizerCells.outerHeight(headerHeight);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "floatthead",
"version": "1.2.4",
"version": "1.2.5",
"description": "locking table headers without special css",
"filename": "jquery.floatThead.js",
"dependencies": {},
Expand Down

0 comments on commit 259ffec

Please sign in to comment.