Opened 13 years ago
Closed 13 years ago
#6563 closed enhancement (fixed)
Dialog: enhancement - allow ability to not drag
Reported by: | dante | Owned by: | bill |
---|---|---|---|
Priority: | high | Milestone: | 1.2 |
Component: | Dijit | Version: | 1.1.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
A seemingly common request, and a workaround is available, but pretty ugly (the lazy creation of the moveable makes it difficult) ... a dijit fix would be trivial, but would add a new public parameter. I would suggest 'dragable' as a boolean, true by default, and a one-line addition to Dialog.js:
if(this.titleNode && this.dragable){ /* make mover */
to prevent the creation of the mover.
This comes up as a user request in my opinion to constitute the functionality, and it is extremely low-risk / api-break free.
will attach trivial patch.
Attachments (3)
Change History (9)
comment:1 Changed 13 years ago by
Summary: | [dijit] Dialog enhancement - allow ability to not drag → Dialog: enhancement - allow ability to not drag |
---|
comment:2 Changed 13 years ago by
comment:3 Changed 13 years ago by
still needs CSS to accomodate draggable=false on the titlebar, but that's really simple now it has dijitDialogFixed on this.domNode
comment:4 follow-up: 5 Changed 13 years ago by
Ok, it's looking pretty good, note that this patch also fixes #6502... there are a few issues:
- when screen is resized dialog doesn't recenter, even if user *hasn't* moved it
- when user moves and dialog, closes it, and then reopens it, it should be centered, right? instead it's at the position the user moved it to the previous time
- "&& p.t && p.l" checks are unneeded and problematic in case that p.t and/or p.l is 0, which is a valid (and non-special) value
- spelling typo on "
// dragable: Boolean
" - comment for layout function is wrong: need to explain behavior on resize and on scroll for when user has/has not moved the dialog. Actually should write that in the description of the widget too.
comment:5 Changed 13 years ago by
Replying to bill:
The first point about recenter: Dialog doesn't currently do that. only the underlay listens to window.resize. moving _resizeHandler in underlay to dialog _modalConnects would solve the re-centering on window resize issue.
The second item/point, re: move->close->reopen ... it's debatable, but trivial to implement what you want. in hide:function()
if(this._relativePosition){ delete this._relativePosition }
though playing with it, i sort of like it showing where i last put it. maybe a recenter="" boolean? anyway both of those points are trivial fixes.
the other two are documentation, so I suppose we need to determine the behavior it should have.
i will address the p && p.t checks. I think p.t !== undefined
should cover it.
comment:6 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
(In [13355]) Enhance Dialog so:
- if the user has moved the dialog then don't recenter it on browser window resize or scroll. Rather, treat it as though it's position:fixed. (fixes #6502)
- add draggable initialization parameter, to (optionally) prevent dialogs from being dragged (fixes #6563)
Patch from Peter Higgins.
This would involve the following changes: