Skip to content

Commit

Permalink
Fix jQuery 3.x issue
Browse files Browse the repository at this point in the history
  • Loading branch information
RockinRoel committed Sep 4, 2017
1 parent 374a90b commit 629e061
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Wt/StdGridLayoutImpl2.C
Expand Up @@ -50,9 +50,15 @@ StdGridLayoutImpl2::StdGridLayoutImpl2(WLayout *layout, Impl::Grid& grid)
LOAD_JAVASCRIPT(app, THIS_JS, "layouts2", appjs1);

app->doJavaScript(app->javaScriptClass() + ".layouts2.scheduleAdjust();");
app->doJavaScript("$(window).load(function() { "
+ app->javaScriptClass() + ".layouts2.scheduleAdjust();"
+ "});");
app->doJavaScript("(function(){"
"var f=function(){"
+ app->javaScriptClass() + ".layouts2.scheduleAdjust();"
"};"
"if($().jquery.startsWith('1.'))"
"$(window).load(f);"
"else "
"$(window).on('load',f);"
"})();");

WApplication::instance()->addAutoJavaScript
("if(" + app->javaScriptClass() + ".layouts2) "
Expand Down

0 comments on commit 629e061

Please sign in to comment.