I have my big app running with jmvc 3.2. I've had a lot of interesting, small problems that I'll explain later but I have one that is perplexing me no end.
I have added all of my (200) ejs templates to the steal script. I have a login panel that appears either in a corner or centered. To center it, I calculate its position based on the browser window and width of the dom object.
Here's the weird thing: Since I added the templates to the steal script, this.element.width() usually gets the width wrong!
If I have the controller console.log(width) it will say "1364". If I break immediately after that statement and check this.element.width(), it will tell me the correct value, 253. It seems obvious that this is a timing issue. One that I can't understand at all.
Can any of you?
ps, 1) Once in awhile it gets the right answer. 2) the width is coded in the css that creates the element, not added later.
I am able to force it to be correct with the expedient of making the initializing function in the steal script wait a tenth of a second before starting the system. Obviously, this is a hack. I look forward to advice on how to do it better.