[ 3 posts ]

Greg Hinch

YUI Contributor

  • Username: greghinch
  • Joined: Wed Jun 03, 2009 10:49 am
  • Posts: 73
  • Location: Fairfax, CA , USA
  • Twitter: greghinch
  • GitHub: ghinch
  • Gists: ghinch
  • IRC: gr-eg
  • Offline
  • Profile
Tags:

Multiple modal masks

Post Posted: Tue Jun 22, 2010 2:38 pm
+0-
Hi Eric,
I was wondering if there was a reason you have every Overlay instance that is plugged with OverlayModal create a separate mask node, rather than just creating a mask node once and attaching it statically to the class, so that all instances can reference it?
Thanks,
Greg

Eric Ferraiuolo

YUI Developer

  • Username: ericf
  • Joined: Mon Jan 12, 2009 8:26 pm
  • Posts: 380
  • Location: Boston, MA
  • Twitter: ericf
  • GitHub: ericf
  • Gists: ericf
  • IRC: eric_f
  • YUI Developer
  • Offline
  • Profile
Tags:

Re: Multiple modal masks

Post Posted: Tue Jun 22, 2010 4:01 pm
+0-
Greg,

My reasoning behind the multiple masks is to make the Overlay with it's MaskNode a "unit". You can reference the MaskNode on a particular Overlay instance by calling myOverlay.get('maskNode'). I wanted to make sure the feature worked in the case when multiple Overlays plugged with Y.Plug.OverlayModal are visible at the same time, and they stacked correctly according to their z-indexes; where the top-most Overlay would mask all other Overlays.

Another thing to note: the MaskNode is inserted into the Overlay's parentNode as the firstChild. When the Overlay's z-index property changes, via myOverlay.set('zIndex', 10), the MaskNode's z-index is updated to be the same value. Since the MaskNode exists before the Overlay in the markup it will be behind the Overlay, masking the contents underneath.

This approach isn't ideal, and I'd like to make it better and more robust; it hasn't yet become an issue for mean and my use-cases but I can imagine some in which it could be a problem. I should probably do a deep-dive and investigation on how other libraries, or even YUI 2.x, approach this issue. If you'd like to help me figure out a super robust way to deal with issues surrounding Overlay's and masking I'm all ears. One additional feature I've had in the back of my mind is the ability to mask only a particular node instead of always the whole viewport.

Are you running into any issues in your code with the current approach to masking? If so hopefully this will help you get through them, or you could explain them and we could try to figure out a solution.
Eric Ferraiuolo

Greg Hinch

YUI Contributor

  • Username: greghinch
  • Joined: Wed Jun 03, 2009 10:49 am
  • Posts: 73
  • Location: Fairfax, CA , USA
  • Twitter: greghinch
  • GitHub: ghinch
  • Gists: ghinch
  • IRC: gr-eg
  • Offline
  • Profile

Re: Multiple modal masks

Post Posted: Fri Jun 25, 2010 8:29 am
+0-
I do like the idea of being able to mask only specific nodes, maybe by having a maskTarget attribute that defaults to the body node. Personally I feel that it kind of goes in the face of the whole purpose of modality if you allow multiple modal dialogs to appear on top of each other, but I suppose not having that limitation gives developers the freedom to find their own way. With the way I want to use it, I think I'm also going to look into making a modal extension for Widget rather than a plugin for Overlay (all widgets have the show/hide functionality so could potentially be modal I would think). I'll let you know what I come up with.

Greg
  [ 3 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum