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
This commit is contained in:
Timo Tijhof 2015-11-19 23:50:46 +00:00
parent cfcdefc297
commit 020956d070

View file

@ -26,7 +26,7 @@
// if we haven't already bound our resize handler, bind it now // if we haven't already bound our resize handler, bind it now
if ( !$.collapsibleTabs.boundEvent ) { if ( !$.collapsibleTabs.boundEvent ) {
$( window ).on( 'resize', $.debounce( 500, function () { $( window ).on( 'resize', $.debounce( 100, function () {
$.collapsibleTabs.handleResize(); $.collapsibleTabs.handleResize();
} ) ); } ) );
$.collapsibleTabs.boundEvent = true; $.collapsibleTabs.boundEvent = true;