EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: glarsen on May 29, 2014, 12:14:39 PM



Title: z-index on windows
Post by: glarsen on May 29, 2014, 12:14:39 PM
Hi,

Clicking on a window header (on panel with other non-modal windows) brings it to the front.   Is it possible to extend this ability to other parts of the window (borders, other contents)?

Tried this but it's not catching any clicks:    $('.panel.window').on('click', function()

Thanks,
Gary


Title: Re: z-index on windows
Post by: stworthy on May 30, 2014, 08:41:12 AM
Please try this:
Code:
$('div.window').click(function(){
$(this).children('div.window-body').window('open')
})


Title: Re: z-index on windows
Post by: glarsen on May 30, 2014, 11:18:23 AM
Hi,

That's not firing either.  Not a show stopper but if you have any other ideas I can try please let me know.

Thanks,
gary


Title: Re: z-index on windows
Post by: stworthy on May 30, 2014, 05:37:34 PM
Please refer to this example http://jsfiddle.net/57B9J/. Clicking any area of a window will brings it to the front.


Title: Re: z-index on windows
Post by: glarsen on May 31, 2014, 06:28:01 AM
Thanks to the example. Must have done something wrong.

gary


Title: Re: z-index on windows
Post by: glarsen on May 31, 2014, 08:12:46 AM
Hi,

I didn't mention that the panel was in a layout, but that also worked using HTML.

Was able to reproduce the issue when creating the windows with JavaScript so I must be doing something wrong there.  Could you check for me?

http://jsfiddle.net/glarsen/Yd2pN/2/ (http://jsfiddle.net/glarsen/Yd2pN/2/)

Clicking the window header will display the window, but clicking the body does nothing.

Thanks,
gary


Title: Re: z-index on windows
Post by: glarsen on May 31, 2014, 08:15:57 AM
Hi again,

Also noticed that when a window title wraps it bleeds into the body.  It it possible to adjust the header height to fit?

Thanks


Title: Re: z-index on windows
Post by: stworthy on May 31, 2014, 08:25:19 AM
This example works fine.
http://jsfiddle.net/Yd2pN/3/


Title: Re: z-index on windows
Post by: glarsen on May 31, 2014, 08:43:26 AM
Sorry, forgot to add the click event. 

I must have something blocking clicks somewhere.

Thanks



Title: Re: z-index on windows
Post by: glarsen on May 31, 2014, 08:55:51 AM
I think it's a DOM order thing.  When I put .click at the top of the script the window clicks don't work.

http://jsfiddle.net/glarsen/Yd2pN/4/ (http://jsfiddle.net/glarsen/Yd2pN/4/)

The app creates windows dynamically from drop events onto the panel. How can hook up new windows to the .click event?

Sorry if this is some simple JQuery thing I don't know yet,
gary


Title: Re: z-index on windows
Post by: glarsen on May 31, 2014, 09:04:51 AM
Got it!

    $(document).on('click', 'div.window', function(){
      $(this).children('div.window-body').window('open')
    })


Thanks again for you help.