Skip to content

Instantly share code, notes, and snippets.

@marcosfreitas
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcosfreitas/99fec6d3f6e9329f4c66 to your computer and use it in GitHub Desktop.
Save marcosfreitas/99fec6d3f6e9329f4c66 to your computer and use it in GitHub Desktop.
JCK WOOTHUMBS 4.0.0 - Manual Fix for Maximum call stack size exceeded error. If you have the license for the suport, don't do this, upgrade your version. But you don't have... :)
/* @author: Marcos Freitas */
/*
* Into function triggerSlider() replace the call for the function triggerEffects()
*/
// passing the limite of recursive executions
triggerEffects(10);
/*
* Modify the Function triggerEffects()
*/
// ! Trigger Effects
// - Recursive Function causing "Maximum call stack size exceeded error"
// - Added a limit var to control the limit of recursive calls
function triggerEffects(limit){
// se o limite não for definido a função não executa o resto do script
if ( ! limit) {
return;
}
var $slider = $("."+jck_wt_vars.slug).data('royalSlider');
if($slider) {
if(jckTrueFalse(jck_wt_vars.options.enableLightbox)) triggerFullscreen();
if(jckTrueFalse(jck_wt_vars.options.enableZoom)) triggerZoom();
} else {
// calling this function when the value of limit will decreasing
triggerEffects(--limit);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment