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

[Solved] Check if window is open client-side

1 Answer 58 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cole
Top achievements
Rank 1
Cole asked on 26 Mar 2012, 07:57 PM
I was wondering if someone could tell me how to check if a window I created is open or not from Javascript.  I am trying to only call open if the window isn't already being shown, and haven't been able to find anything on the subject.  Any help would be greatly appreciated.

Thanks!

Cole Ford

1 Answer, 1 is accepted

Sort by
0
Alex Gyoshev
Telerik team
answered on 27 Mar 2012, 08:46 AM
var dialog = $("#window"),
    visible = dialog.is(":visible"); 

if (!visible) {
    dialog.data("tWindow").open();
}


Please note that the window does not do anything when calling open() several times in a row, so you might not need to check for that.

Kind regards,
Alex Gyoshev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
Tags
Window
Asked by
Cole
Top achievements
Rank 1
Answers by
Alex Gyoshev
Telerik team
Share this question
or