Hi Carlos, Everything works fine now. Tranks you for all. Hiedra.
Mª José Esteve García Dpto. Sistemas [email protected] Informática del Este S.L. C/ Camino Peñarrocha, 3 – Esc. D – Planta 1ª 46023 - Valencia (ESPAÑA) Tel: +34 963 485 874 | Fax: +34 963 483 706 www.iest.com -----Mensaje original----- De: Carlos Rovira <[email protected]> Enviado el: jueves, 9 de enero de 2020 13:20 Para: [email protected] Asunto: Re: Jewel: PopUpView.as exception Hi Maria Jose, just applied a fix. Thanks for notifying about it! I'll be changing setTimeOut calls for something like requestAnimationFrame at some time. When I develop this code, I had issues for different browsers. Now that we have more browser control, we can do smarter management and maybe left setTimeOut as a fallback for browsers that does not work with better methods. Thanks! :) El mié., 8 ene. 2020 a las 19:32, Maria Jose Esteve (<[email protected]>) escribió: > Hi, > In the PopUpView.as class, we use popUpVisible property to change his > visibility. > To display his content, we use the "setTimeout" function, which > executes the prepareForPopUp function after 300 milliseconds: > > setTimeout(prepareForPopUp, 300); > > If you show and hide in a short time frame, the prepareForPopUp event > fires after the value of the _popUp variable has been set to NULL > causing > exception: > > TypeError: Cannot read property 'addClass' of null > > Would it be correct to verify the _PopUp value before calling it? ... > Something like > > private function prepareForPopUp():void > { > + if (_popUp) > + _popUp.addClass("open"); > > COMPILE::JS > { > //avoid scroll in html > document.body.classList.add("viewport"); > //cancelAnimationFrame(rq); > } > } > > > Thank you, > Hiedra. > -- Carlos Rovira http://about.me/carlosrovira
