Detecting minimize and un-minimize

2 posts, 0 answers
  1. Michael
    Michael avatar
    6 posts
    Member since:
    Dec 2012

    Posted 12 May Link to this post

    I'm trying to get the Kendo window to behave like Windows - dive down to the bottom of the browser on minimize and restore in some visible position on restore. The first part isn't a problem - I trap the Minimize event, calculate the viewport dimensions and the window dimensions, and do a jQuery animate to move the now-minimized window where I want it.

    The problem comes in when it restores. As we can see on when we edit the code to handle minimize, only the first time the window is restored is there any event at all -- subsequent minimizes do pop a minimize event, but the second and further un-minimizes throw no event whatsoever.

    I took a look at the approach given on where we can trap the click to the minimize button, and that looked promising. The drawback there is that we do it on mousedown for the button, and I can't figure out how to get the kendoWindow data() in a generic way from the mousedown event handler. I can find the DOM element, but it doesn't have any relation to the DIV where I hooked the kendoWindow. I figure that I need that widget in order to do the minimize() call so that I can then move the minimized (or un-minimized) window if I so desire.

    Hope this makes sense. Any thoughts as to where I shoujld go from here?


    -- Michael


  2. Dimo
    Dimo avatar
    8318 posts

    Posted 16 May Link to this post

    Hi Michael,

    Please do the following to obtain the Window widget object:

    - from the minimize button, traverse up to the .k-window element
    - find the .k-window-content child of the .k-window element. This is the <div> to which the widget object is attached to.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top