Open centurianii opened 6 years ago
...and yes, I added an internal id counter/storage in my code that produces the windows - a kind of a higher code over your code which is not bad as an approach. Of course you can add such a counter internally but I have some doubts about it's usability from that lower end.
That reminded me another issue: a window should change stack order on click events moving from a lower layer to the front one. Hopefully, the solution can be done from a higher end again by applying z-index
at .popupwindow_overlay
s so you don't have to update again-and-again the basic project but instead, create usability modules
based on it.
If we want to catch the close event and destroy the window we get en error only when the window is minimized!
That's because function
function _Close(popupWindow)
tries to un-minimize it that results in deferreds at functionfunction _Unminimize(popupWindow)
while at the same time it triggers the close event. I'm reffering to these 2 lines at the last function:At the time we catch the event and destroy the window with
function _Destroy(popupWindow)
it seems that jquery hasn't finished with the 1st deferred which callsfunction _ChangePosition(popupWindow, params)
where linevar settings = popupWindow.data("settings");
fires an error (although Firefox dev tools give me an error from the same command but atfunction _CheckPosition(popupWindow)
!?).To make a long story short, by the time you introduce deferreds in your code everything else is dependent upon these especially if the code that creates deferreds at the same time triggers events like
function _Close(popupWindow)
, i.e. my code should question the internal deferred:The solution without applying big modifications to the structure: add another key in
var _defaults
:and change
function _Close(popupWindow)
like:Now I can destroy minimized windows from the close button!