This is a migrated thread and some comments may be shown as answers.

Detecting minimize and un-minimize

1 Answer 286 Views
Window
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 2
Michael asked on 12 May 2016, 09:08 PM

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 http://demos.telerik.com/kendo-ui/window/events 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 http://www.telerik.com/forums/store-window-minimize-state 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?

Thanks.

-- Michael

 

1 Answer, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 16 May 2016, 03:19 PM
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.

http://docs.telerik.com/kendo-ui/controls/layout/window/overview#html-structure-and-dom-placement

Regards,
Dimo
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Window
Asked by
Michael
Top achievements
Rank 2
Answers by
Dimo
Telerik team
Share this question
or