Permalink
Browse files

Updates versions.

  • Loading branch information...
1 parent 824de8e commit e230fc91b253bf5e955981698d9580d7cf5dea8f @asual asual committed Mar 2, 2010
Showing with 12 additions and 14 deletions.
  1. +10 −12 dist/jquery.thead-1.1.js
  2. +1 −1 dist/jquery.thead-1.1.min.js
  3. +1 −1 samples/jquery.thead-1.1.min.js
@@ -6,7 +6,7 @@
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
- * Date: 2010-03-02 09:34:29 +0200 (Tue, 02 Mar 2010)
+ * Date: 2010-03-02 15:00:43 +0200 (Tue, 02 Mar 2010)
*/
(function($) {
@@ -27,7 +27,7 @@
_scroll = function() {
$(_tables).each(function() {
var w, s = 'thead tr th, thead tr td',
- t = $('table.jquery-thead, table', this.parent().prev()).get(0),
+ t = $('table', this.parent().prev()).get(0),
c = $('caption', t),
collapse = $(t).css('border-collapse') == 'collapse',
ths = $(s, t),
@@ -60,7 +60,7 @@
}, 50);
}
});
- $('table.jquery-thead, .jquery-thead table').thead();
+ $('.jquery-thead').thead();
}
});
@@ -82,19 +82,17 @@
$.fn.thead = function() {
if (_supported) {
- var collection = $(this);
- collection.each(function() {
- var table, parent = $(this).parent(), thead = $('thead', this);
+ $(this).each(function() {
+ var table = this.tagName.toLowerCase() == 'table' ? $(this) : $('table', this), parent = table.parent(), thead = $('thead', table);
if (thead.length) {
- var clazz = $(this).attr(CLAZZ),
- cp = $(this).attr(CELLPADDING),
- cs = $(this).attr(CELLSPACING),
- table = $('<table />').attr(CLAZZ, clazz)
+ var clazz = table.attr(CLAZZ),
+ cp = table.attr(CELLPADDING),
+ cs = table.attr(CELLSPACING);
+ _tables.push($('<table />').attr(CLAZZ, clazz)
.attr(CELLPADDING, cp ? cp : 1)
.attr(CELLSPACING, cs ? cs : 2)
.css({position: 'fixed', top: 0}).appendTo($('<' + parent.get(0).tagName + '/>')
- .attr(CLAZZ, parent.attr(CLAZZ)).insertAfter(parent));
- _tables.push(table.append($(thead).clone(true)));
+ .attr(CLAZZ, parent.attr(CLAZZ)).insertAfter(parent)).append($(thead).clone(true)));
}
});
}
@@ -1 +1 @@
-/* * jQuery Thead Plugin v1.1 * http://www.asual.com/jquery/thead/ * * Copyright (c) 2009-2010 Rostislav Hristov * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Date: 2010-03-02 09:34:29 +0200 (Tue, 02 Mar 2010) */(function(i){var d="class",g="cellpadding",a="cellspacing",j=navigator.userAgent,m=i(window),k=i(document),f=[],h=4,e=!(i.browser.msie&&parseFloat(j.substr(j.indexOf("MSIE")+h))<7),c=null,l=function(o){var n=parseInt(o,10);return isNaN(n)?0:n},b=function(){i(f).each(function(){var n,q="thead tr th, thead tr td",p=i("table.jquery-thead, table",this.parent().prev()).get(0),v=i("caption",p),u=i(p).css("border-collapse")=="collapse",o=i(q,p),r=k.scrollTop()-i(p).offset().top+h;if(v.length){r-=v.get(0).clientHeight}i(q,this).each(function(s){var t=o.eq(s).get(0);n=i(t).css("width");i(this).css("width",n!="auto"?n:t.clientWidth-l(i(t).css("padding-left"))-l(i(t).css("padding-right"))+"px")});i(this).css({display:(r>h&&r<p.clientHeight-i("tr:last",p).height()-h*2)?i(p).css("display"):"none",left:i(p).offset().left-k.scrollLeft()+"px",width:i(p).get(0).offsetWidth})})};i(function(){if(e){m.scroll(b).resize(function(){if(c==null){c=setInterval(function(){if(c){c=clearInterval(c)}b()},50)}});i("table.jquery-thead, .jquery-thead table").thead()}});i.thead=(function(){return{update:function(){i(f).each(function(){var o=i("thead",i("table.jquery-thead, table",this.parent().prev()).get(0));var n=i("thead",this);if(n.html()!=o.html()){n.parent().append(o.clone(true));n.remove();b()}})}}})();i.fn.thead=function(){if(e){var n=i(this);n.each(function(){var r,q=i(this).parent(),s=i("thead",this);if(s.length){var o=i(this).attr(d),t=i(this).attr(g),p=i(this).attr(a),r=i("<table />").attr(d,o).attr(g,t?t:1).attr(a,p?p:2).css({position:"fixed",top:0}).appendTo(i("<"+q.get(0).tagName+"/>").attr(d,q.attr(d)).insertAfter(q));f.push(r.append(i(s).clone(true)))}})}b()}})(jQuery);
+/* * jQuery Thead Plugin v1.1 * http://www.asual.com/jquery/thead/ * * Copyright (c) 2009-2010 Rostislav Hristov * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Date: 2010-03-02 15:00:43 +0200 (Tue, 02 Mar 2010) */(function(i){var d="class",g="cellpadding",a="cellspacing",j=navigator.userAgent,m=i(window),k=i(document),f=[],h=4,e=!(i.browser.msie&&parseFloat(j.substr(j.indexOf("MSIE")+h))<7),c=null,l=function(o){var n=parseInt(o,10);return isNaN(n)?0:n},b=function(){i(f).each(function(){var n,q="thead tr th, thead tr td",p=i("table",this.parent().prev()).get(0),v=i("caption",p),u=i(p).css("border-collapse")=="collapse",o=i(q,p),r=k.scrollTop()-i(p).offset().top+h;if(v.length){r-=v.get(0).clientHeight}i(q,this).each(function(s){var t=o.eq(s).get(0);n=i(t).css("width");i(this).css("width",n!="auto"?n:t.clientWidth-l(i(t).css("padding-left"))-l(i(t).css("padding-right"))+"px")});i(this).css({display:(r>h&&r<p.clientHeight-i("tr:last",p).height()-h*2)?i(p).css("display"):"none",left:i(p).offset().left-k.scrollLeft()+"px",width:i(p).get(0).offsetWidth})})};i(function(){if(e){m.scroll(b).resize(function(){if(c==null){c=setInterval(function(){if(c){c=clearInterval(c)}b()},50)}});i(".jquery-thead").thead()}});i.thead=(function(){return{update:function(){i(f).each(function(){var o=i("thead",i("table.jquery-thead, table",this.parent().prev()).get(0));var n=i("thead",this);if(n.html()!=o.html()){n.parent().append(o.clone(true));n.remove();b()}})}}})();i.fn.thead=function(){if(e){i(this).each(function(){var q=this.tagName.toLowerCase()=="table"?i(this):i("table",this),p=q.parent(),r=i("thead",q);if(r.length){var n=q.attr(d),s=q.attr(g),o=q.attr(a);f.push(i("<table />").attr(d,n).attr(g,s?s:1).attr(a,o?o:2).css({position:"fixed",top:0}).appendTo(i("<"+p.get(0).tagName+"/>").attr(d,p.attr(d)).insertAfter(p)).append(i(r).clone(true)))}})}b()}})(jQuery);
@@ -1 +1 @@
-/* * jQuery Thead Plugin v1.1 * http://www.asual.com/jquery/thead/ * * Copyright (c) 2009-2010 Rostislav Hristov * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Date: 2010-03-02 09:34:29 +0200 (Tue, 02 Mar 2010) */(function(i){var d="class",g="cellpadding",a="cellspacing",j=navigator.userAgent,m=i(window),k=i(document),f=[],h=4,e=!(i.browser.msie&&parseFloat(j.substr(j.indexOf("MSIE")+h))<7),c=null,l=function(o){var n=parseInt(o,10);return isNaN(n)?0:n},b=function(){i(f).each(function(){var n,q="thead tr th, thead tr td",p=i("table.jquery-thead, table",this.parent().prev()).get(0),v=i("caption",p),u=i(p).css("border-collapse")=="collapse",o=i(q,p),r=k.scrollTop()-i(p).offset().top+h;if(v.length){r-=v.get(0).clientHeight}i(q,this).each(function(s){var t=o.eq(s).get(0);n=i(t).css("width");i(this).css("width",n!="auto"?n:t.clientWidth-l(i(t).css("padding-left"))-l(i(t).css("padding-right"))+"px")});i(this).css({display:(r>h&&r<p.clientHeight-i("tr:last",p).height()-h*2)?i(p).css("display"):"none",left:i(p).offset().left-k.scrollLeft()+"px",width:i(p).get(0).offsetWidth})})};i(function(){if(e){m.scroll(b).resize(function(){if(c==null){c=setInterval(function(){if(c){c=clearInterval(c)}b()},50)}});i("table.jquery-thead, .jquery-thead table").thead()}});i.thead=(function(){return{update:function(){i(f).each(function(){var o=i("thead",i("table.jquery-thead, table",this.parent().prev()).get(0));var n=i("thead",this);if(n.html()!=o.html()){n.parent().append(o.clone(true));n.remove();b()}})}}})();i.fn.thead=function(){if(e){var n=i(this);n.each(function(){var r,q=i(this).parent(),s=i("thead",this);if(s.length){var o=i(this).attr(d),t=i(this).attr(g),p=i(this).attr(a),r=i("<table />").attr(d,o).attr(g,t?t:1).attr(a,p?p:2).css({position:"fixed",top:0}).appendTo(i("<"+q.get(0).tagName+"/>").attr(d,q.attr(d)).insertAfter(q));f.push(r.append(i(s).clone(true)))}})}b()}})(jQuery);
+/* * jQuery Thead Plugin v1.1 * http://www.asual.com/jquery/thead/ * * Copyright (c) 2009-2010 Rostislav Hristov * Dual licensed under the MIT or GPL Version 2 licenses. * http://jquery.org/license * * Date: 2010-03-02 15:00:43 +0200 (Tue, 02 Mar 2010) */(function(i){var d="class",g="cellpadding",a="cellspacing",j=navigator.userAgent,m=i(window),k=i(document),f=[],h=4,e=!(i.browser.msie&&parseFloat(j.substr(j.indexOf("MSIE")+h))<7),c=null,l=function(o){var n=parseInt(o,10);return isNaN(n)?0:n},b=function(){i(f).each(function(){var n,q="thead tr th, thead tr td",p=i("table",this.parent().prev()).get(0),v=i("caption",p),u=i(p).css("border-collapse")=="collapse",o=i(q,p),r=k.scrollTop()-i(p).offset().top+h;if(v.length){r-=v.get(0).clientHeight}i(q,this).each(function(s){var t=o.eq(s).get(0);n=i(t).css("width");i(this).css("width",n!="auto"?n:t.clientWidth-l(i(t).css("padding-left"))-l(i(t).css("padding-right"))+"px")});i(this).css({display:(r>h&&r<p.clientHeight-i("tr:last",p).height()-h*2)?i(p).css("display"):"none",left:i(p).offset().left-k.scrollLeft()+"px",width:i(p).get(0).offsetWidth})})};i(function(){if(e){m.scroll(b).resize(function(){if(c==null){c=setInterval(function(){if(c){c=clearInterval(c)}b()},50)}});i(".jquery-thead").thead()}});i.thead=(function(){return{update:function(){i(f).each(function(){var o=i("thead",i("table.jquery-thead, table",this.parent().prev()).get(0));var n=i("thead",this);if(n.html()!=o.html()){n.parent().append(o.clone(true));n.remove();b()}})}}})();i.fn.thead=function(){if(e){i(this).each(function(){var q=this.tagName.toLowerCase()=="table"?i(this):i("table",this),p=q.parent(),r=i("thead",q);if(r.length){var n=q.attr(d),s=q.attr(g),o=q.attr(a);f.push(i("<table />").attr(d,n).attr(g,s?s:1).attr(a,o?o:2).css({position:"fixed",top:0}).appendTo(i("<"+p.get(0).tagName+"/>").attr(d,p.attr(d)).insertAfter(p)).append(i(r).clone(true)))}})}b()}})(jQuery);

0 comments on commit e230fc9

Please sign in to comment.