Skip to main content

Search and Top Navigation

#5430 closed bug (notabug)

Opened March 25, 2010 09:56PM UTC

Closed March 26, 2010 12:58AM UTC

Last modified October 11, 2012 09:15PM UTC

isOpen returns object instead of undefined (as 1.7.2 did) when called on a non dialog object

Reported by: johnwebbcole Owned by:
Priority: major Milestone:
Component: ui.core Version: 1.8
Keywords: Cc:
Blocked by: Blocking:
Description

In 1.7.2 when you called isOpen on an element that had not had a dialog created on it, you would get 'undefined'. Same held true for an element that had the .dialog('destroy') method called on it.

In 1.8, isOpen returns an object under the same situations. This hampers routines checking to see if a dialog is already up (in my case a dialog with a progress bar in it).

Here an example:

<html>
<head>


<!-- <link href="css/ui-lightness/jquery-ui-1.8.custom.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script> -->
<link href="css/ui-lightness/jquery-ui-1.8.custom.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.8.custom.min.js"></script>
</head>
<body>

<script type="text/javascript">
	
	$(function() {
		alert($("#Dialog").dialog('isOpen'));
		$("#Dialog").dialog({title: 'Alert',
                    autoOpen: false,
                    modal: true});
		alert($("#Dialog").dialog('isOpen'));
		
		$("#Dialog").dialog('destroy');
		alert($("#Dialog").dialog('isOpen'));
	});

</script>
<div id="Dialog">test
    </div>
</body>
</html> 

1.7.2 returns

undefined

false

undefined

1.8 returns

object

false

object

Attachments (0)
Change History (2)

Changed March 26, 2010 12:58AM UTC by scottgonzalez comment:1

resolution: → invalid
status: newclosed

Methods are not meant to be used when the plugin isn't initialized.

Changed October 11, 2012 09:15PM UTC by scottgonzalez comment:2

milestone: TBD

Milestone TBD deleted