Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#5430 closed bug (notabug)

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

Change History (2)

comment:1 Changed 10 years ago by Scott González

Resolution: invalid
Status: newclosed

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

comment:2 Changed 8 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.