Ticket #6370 (closed defect: worksforme)
Dialog: onLoad does not check for visibility like layout()
| Reported by: | guest | Owned by: | bill |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.2 |
| Component: | Dijit | Version: | 1.1.0 |
| Severity: | normal | Keywords: | dialog onload visibility hidden |
| Cc: |
Description
In version 1.1.0, when you create a dijit.Dialog the css has been changed from display: "none" to visibility: "hidden" when compared to pre-1.1.0.
I noticed that my dialog boxes were being hidden but the div's were centered in the middle of my screen, and the textbox's within the Dialog were editable even though I couldn't see them.
At line 387 in the layout() function of diji\Dialog.js you do a check to make sure that the dialog isn't hidden before calling _position() which places the dialog in the middle of the screen. However, at line 201 of the same file, in the onLoad() function you do not perform the same check which results in a dialog box that is invisible to the user but still editable.
I think the onLoad function should look like this:
onLoad: function(){ // summary: when href is specified we need to reposition the dialog after the data is loaded
if(this.domNode.style.visibility != "hidden"){
this._position();
} this.inherited(arguments);
}