From 020956d070221342540978439c04e97b976ba0c4 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Thu, 19 Nov 2015 23:50:46 +0000 Subject: [PATCH] collapsibleTabs: Debounce resize event at 100ms instead of 500ms A delay of 500ms is quite long and is a bad user experience. Resize should be more responsive than that. Matches other plugins that do the same thing, such as: http://www.paulirish.com/2009/throttled-smartresize-jquery-event-handler/ And also more in accordance with RAIL. https://developers.google.com/web/tools/chrome-devtools/profile/evaluate-performance/rail Change-Id: I076785f82a7786f16ca4fb1564a4972dd23cc56b --- collapsibleTabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/collapsibleTabs.js b/collapsibleTabs.js index bf5ee1c..3c91e4e 100644 --- a/collapsibleTabs.js +++ b/collapsibleTabs.js @@ -26,7 +26,7 @@ // if we haven't already bound our resize handler, bind it now if ( !$.collapsibleTabs.boundEvent ) { - $( window ).on( 'resize', $.debounce( 500, function () { + $( window ).on( 'resize', $.debounce( 100, function () { $.collapsibleTabs.handleResize(); } ) ); $.collapsibleTabs.boundEvent = true;