The resizeHandler method was originally assigned to the onresize handler
only for the *base dyndocument* , which is DynAPI.document. I've
rearranged it so it will handle multiple dyndocs.
The problem with this is that if you have more than one window with a
dyndocument, the resizeHandler doesn't take care of both of them. For
example, if you had a main window and a pop-up window, both with
dyndocuments, resizeHandler is only called when you resize the main
window. Resizing the pop-up does nothing, because resizeHandler (as it
is written now) only affects DynAPI.document.
So I rewrote DynDocument to automatically assign resizeHandler to the
onresize of the frame passed as an argument, which guarantees it will be
executed for *any* dyndocument. If you look in dyndocument.js, in the
constructor you'll see these lines:
frame.onresize = DynAPI.resizeHandler // <-- [5] handle resize within
scope of this frame, not just top-level
...
frame.dyndoc=this //<-- [7] this is much better
So now if we have multiple dyndocuments in multiple frames or windows,
the resizeHandler executes within the scope of the calling window. The
way it was before, resizeHandler was only being called when the
top-level parent window was resized.
So then I had to rewrite the resizeHandler to use "this.dyndoc" ("this"
being the frame object that invoke onresize) instead of defaulting to
DynAPI.document.
Does that make sense?
|