Re: bootstrap affix onload not executed

2016-06-21 Thread D.R.

Hi Carlos,

thanks a lot for the hint and the info, works now as expected.


Kind regards
David


On 21.06.2016 19:29, Carlos Montero Canabal wrote:

Hi,

In Tapestry 5.4.X versions "$(window).on('load', function ()" is never call it 
for requireJs. So you can create a module as:

my-affix-module.js (into META-INF/modules folder) with the code

define([“jquery”, “bootstrap/affix"], function($) {

return function(){

$('#myAffix').affix({
  options...
 });

}

});

And require it on .java

void afterRender() {
 _javaScriptSupport.require(“my-affix-module”);
}

I think it works

Regards

Carlos Montero


El 21/6/2016, a las 13:29, D.R.  escribió:

Hi,

i try this example:
http://www.w3schools.com/bootstrap/bootstrap_affix.asp

with
void afterRender() {
_javaScriptSupport.require("bootstrap/affix");
}

in a T5.4.1 environment, and the affix.js is loaded, require.js and jquery.js 
do some initialization, but the
$(window).on('load', function ()
is never executed. The js debugger never stops inside that function.

Any hint what to do in order to get that working?


Kind regards
David

-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org






-
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



Re: bootstrap affix onload not executed

2016-06-21 Thread Carlos Montero Canabal
Hi,

In Tapestry 5.4.X versions "$(window).on('load', function ()" is never call it 
for requireJs. So you can create a module as:

my-affix-module.js (into META-INF/modules folder) with the code

define([“jquery”, “bootstrap/affix"], function($) {

return function(){

$('#myAffix').affix({
  options...
 });

}

});

And require it on .java

void afterRender() {
_javaScriptSupport.require(“my-affix-module”);
}

I think it works

Regards

Carlos Montero

> El 21/6/2016, a las 13:29, D.R.  escribió:
> 
> Hi,
> 
> i try this example:
> http://www.w3schools.com/bootstrap/bootstrap_affix.asp
> 
> with
>void afterRender() {
>_javaScriptSupport.require("bootstrap/affix");
>}
> 
> in a T5.4.1 environment, and the affix.js is loaded, require.js and jquery.js 
> do some initialization, but the
> $(window).on('load', function ()
> is never executed. The js debugger never stops inside that function.
> 
> Any hint what to do in order to get that working?
> 
> 
> Kind regards
> David
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
>