Skip to content

Commit

Permalink
fixes for #62, #65, #66
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoryak committed Mar 21, 2014
1 parent 901a4ff commit af14927
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 20 deletions.
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
Loading

0 comments on commit af14927

Please sign in to comment.