[Webdialog] onresize firing twice
-
Anyone have a better solution than this:
if(!config.count){ config.count = 1; return; } else{ delete config.count; } </script>
Thanks
edit: changed to actual implementation
-
I don't understand how that code relates to javascript onresize() firing, but if you want to catch the onresize event, your code should be designed to get executed a lot. Resizing is a continuously firing event as it happens.
-
@unknownuser said:
I don't understand how that code relates to javascript onresize() firing, but if you want to catch the onresize event, your code should be designed to get executed a lot. Resizing is a continuously firing event as it happens.
Yes I see. That code is only good for double firing. Here is a marked up shot of what I am doing. Multiple firing is OK except when increasing the number of columns ... they get progressively more or less at each pass. So far I have only experienced two. Any guideline?
Glad to see you back!
-
OK, I think I understand what you are doing now. Why not implement buttons inside your dialog, such as 3 sets of plus/minus buttons to accomplish what you want? It would be more of a standard interface approach to implementing your dialog. Plus, if you ever decided to port to the Mac, your current scheme would not work, as when resizing a Mac dialog, you can only adjust via the bottom right corner.
-
Thanks, Todd, I will do that.
-
Maybe a timer could be used to ignore the rapid-fire events, and then only call the resize code once?
-
-
Thanks Jim and Dan, but only being able to resize using bottom right on Macs knocks the idea on the head.
Anyway it's really only changing the number of columns that needs a new method; the ability to see more letters of the words and more rows is calculated from the new size, so is no problem. But I think I will also provide something for machine owners to select column widths and rows to give them alternative control (like shifting gears in an automatic car).
Thanks again.
-
@dan rathbun said:
onresizeend
http://msdn.microsoft.com/en-us/library/ms536960(VS.85).aspxI did have a look at that. It seems it's for changing the dimensions of the object in a control selection whatever that is. The name is confusing.
-
@chrisglasier said:
@dan rathbun said:
onresizeend
I did have a look at that. It seems it's for changing the dimensions of the object in a control selection whatever that is. The name is confusing.
It has to do with editable content (like a wikipage) which is not what you want. And besides, the phrase "There is no public standard that applies to this event." means it's NOT in the W3C HTML/DHTML spec. It's a MS invention, and may only work in MSIE. (Although, some of those pages on MSDN are out of date.)
So that kills cross-platform unless Safari also implements the feature.
-
(Discusssing Javascript not ruby!)
Just thinking about this a bit...
(1) In order to resize the window, the user must move the mouse OUTSIDE the BODY or DOCUMENT, which fires the onmouseleave event for those Elements.
(2) The onresize event fires (perhaps multiple times,) during user sizing. So just set a wasResized flag from 0 to 1 when the event fires. You don't care how many times the flag is set to 1.
(3) The user (usually) moves the mouse back into the element, and the onmouseenter event fires. So perhaps in BODY onmouseenter handler, check wasResized, if 1, then reset to 0 and call your layout resize/relayout function.
The question is does Safari also implement onmouseenter ??
-
Dan, my view is not to introduce anything that might antagonise Mr Mac ... there's seems enough problems with starting and window.location wobblies as bemoaned in this topic.
On the other hand I would quite like machine owners to be able to determine the way their information is best viewed by manipulating the window - I guess maybe later.
All seems much easier with .hta's but then so limited in other respects.
Thanks for your input.
Advertisement