From f51401e734a33cca259f3e74e7d2fd67e4b8664c Mon Sep 17 00:00:00 2001 From: ppowalowski Date: Sun, 29 Mar 2015 18:49:53 +0200 Subject: [PATCH 1/3] rename for grunt --- jquery.syncheight.js => jquery.syncHeight.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename jquery.syncheight.js => jquery.syncHeight.js (100%) diff --git a/jquery.syncheight.js b/jquery.syncHeight.js similarity index 100% rename from jquery.syncheight.js rename to jquery.syncHeight.js From 40063a8cf64b1fae91843162ce362606d12390ea Mon Sep 17 00:00:00 2001 From: ppowalowski Date: Sun, 29 Mar 2015 18:50:14 +0200 Subject: [PATCH 2/3] version bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d1142bb..2a54682 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "devDependencies": { "grunt": "~0.4.0", "grunt-contrib-jshint": "~0.1.1", - "grunt-contrib-uglify": "~0.1.2", + "grunt-contrib-uglify": "~0.8.0", "grunt-contrib-watch": "~0.3.1", "grunt-contrib-concat": "~0.1.3", "grunt-remove-logging": "~0.1.0" From 36d7b9e39a9a3e0f133fea0da3322a95870e7f28 Mon Sep 17 00:00:00 2001 From: ppowalowski Date: Sun, 29 Mar 2015 18:51:16 +0200 Subject: [PATCH 3/3] requestAnimationFrame to prevent lagging on window resize --- jquery.syncHeight.js | 4 +++- jquery.syncHeight.min.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/jquery.syncHeight.js b/jquery.syncHeight.js index 602fb13..3792820 100755 --- a/jquery.syncHeight.js +++ b/jquery.syncHeight.js @@ -97,7 +97,9 @@ // optional sync refresh on resize event ... if (options.updateOnResize === true) { $(window).bind('resize.syncHeight', function(){ - $(e).syncHeight(); + window.requestAnimationFrame(function(){ + $(e).syncHeight(); + }); }); } return this; diff --git a/jquery.syncHeight.min.js b/jquery.syncHeight.min.js index b7a953c..e2544e4 100644 --- a/jquery.syncHeight.min.js +++ b/jquery.syncHeight.min.js @@ -1,7 +1,7 @@ /* jQuery-syncHeight - v1.5.0 * https://github.com/ginader/syncHeight -* Copyright (c) 2013 Dirk Ginader; +* Copyright (c) 2015 Dirk Ginader; * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ -(function(e){var t=function(){var e=0,t=[["min-height","0px"],["height","1%"]],n=/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],i=n[1]||"",h=n[2]||"0";return"msie"===i&&7>h&&(e=1),{name:t[e][0],autoheightVal:t[e][1]}};e.getSyncedHeight=function(n){var i=0,h=t();return e(n).each(function(){e(this).css(h.name,h.autoheightVal);var t=parseInt(e(this).css("height"),10);t>i&&(i=t)}),i},e.fn.syncHeight=function(n){var i={updateOnResize:!1,height:!1},h=e.extend(i,n),s=this,a=0,c=t().name;return a="number"==typeof h.height?h.height:e.getSyncedHeight(this),e(this).each(function(){e(this).css(c,a+"px")}),h.updateOnResize===!0&&e(window).resize(function(){e(s).syncHeight()}),this},e.fn.unSyncHeight=function(){var n=t().name;e(this).each(function(){e(this).css(n,"")})}})(jQuery); \ No newline at end of file +!function(a){var b=function(){var a=0,b=[["min-height","0px"],["height","1%"]],c=/(msie) ([\w.]+)/.exec(navigator.userAgent.toLowerCase())||[],d=c[1]||"",e=c[2]||"0";return"msie"===d&&7>e&&(a=1),{name:b[a][0],autoheightVal:b[a][1]}};a.getSyncedHeight=function(c){var d=0,e=b();return a(c).each(function(){a(this).css(e.name,e.autoheightVal);var b=parseInt(a(this).css("height"),10);b>d&&(d=b)}),d},a.fn.syncHeight=function(c){var d={updateOnResize:!1,height:!1},e=a.extend(d,c),f=this,g=0,h=b().name;return g="number"==typeof e.height?e.height:a.getSyncedHeight(this),a(this).each(function(){a(this).css(h,g+"px")}),e.updateOnResize===!0&&a(window).bind("resize.syncHeight",function(){window.requestAnimationFrame(function(){a(f).syncHeight()})}),this},a.fn.unSyncHeight=function(){a(window).unbind("resize.syncHeight");var c=b().name;a(this).each(function(){a(this).css(c,"")})}}(jQuery); \ No newline at end of file