Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#4347 closed bug (notabug)

dialog('isOpen') returns an object instead of boolean

Reported by: BigBadaboom Owned by:
Priority: major Milestone:
Component: ui.dialog Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

The 'isOpen' method is supposed to return true or false. Instead it returns an object.

To reproduce:

Load the attached HTML test file.

Expected result:

Alert box should read "isOpen=true"

Actual result:

Alert box reads "isOpen=[object Object]"

Attachments (1)

isOpenTest.html (369 bytes) - added by BigBadaboom 11 years ago.
Test case (HTML)

Download all attachments as: .zip

Change History (10)

Changed 11 years ago by BigBadaboom

Attachment: isOpenTest.html added

Test case (HTML)

comment:1 Changed 11 years ago by BigBadaboom

NVM. I was using an old version of jQuery UI. I see now from the changelog that this feature was added in 1.7.

Perhaps, instead of being closed, this bug could be treated as a request to alter the documentation for isOpen to say: "Added in version 1.7".

comment:2 Changed 11 years ago by Cloudream

Resolution: invalid
Status: newclosed

Docs on site are always targeting to last stable release, you could check old docs on http://docs.jquery.com/UI e.g. http://docs.jquery.com/UI/API/1.5/Dialog

comment:3 Changed 9 years ago by Karthik

No the bug has not been closed still it exists in 1.8.6. Kindly Check and Fix!

comment:4 in reply to:  3 ; Changed 9 years ago by Scott González

Replying to Karthik:

No the bug has not been closed still it exists in 1.8.6. Kindly Check and Fix!

This is definitely fixed. Please provide an example showing the problem.

comment:5 in reply to:  4 Changed 9 years ago by Karthik

Replying to scott.gonzalez:

Replying to Karthik:

No the bug has not been closed still it exists in 1.8.6. Kindly Check and Fix!

This is definitely fixed. Please provide an example showing the problem.

The bug is still there here is the criteria where I am facing the problem,

//This is the first function that I am calling to Initialize and load the dialog
function openTheModal(){
$("#dialog-modal").dialog({
			height: 140,
			modal: true,
                        open:function(ui,event){
                        $("#dialog-modal").load("test1.html");//Where dialog-modal is a div and I am successfully loading the html
                        }
});
}

// This is the second function which I will call to get the status of the dialog and getting the result as object
function checkIfDialogOpen(){
alert($("#dialog-modal").dialog("isOpen")); // Here it is returning Object , even I tried assigning that to var and checked results and got the same.
}

Please kindly Help and Fix!

Regards,

Karthik

comment:6 Changed 9 years ago by Scott González

Sounds like you're probably calling isOpen() before instantiating the dialog. Please use the forums for help.

comment:7 in reply to:  6 ; Changed 9 years ago by Karthik

Replying to scott.gonzalez:

Sounds like you're probably calling isOpen() before instantiating the dialog. Please use the forums for help.

No I initiated the dialog in the first function and I have missed out $("#dialog-modal").dialog("open") in the first function.Even after that it is still returning object. If possible provide a best case so that I will try it out.

comment:8 in reply to:  7 Changed 9 years ago by Scott González

Replying to Karthik:

If possible provide a best case so that I will try it out.

https://github.com/jquery/jquery-ui/blob/master/tests/unit/dialog/dialog_methods.js#L84-98

Seriously, this has been working for a LONG time. Please use the forums, I won't be responding to any more comments on this ticket.

comment:9 Changed 7 years ago by Scott González

Milestone: TBD

Milestone TBD deleted

Note: See TracTickets for help on using tickets.