Hi Richard,
I mentioned thousands but hundreds are enough to cause the delay.
I like the idea of externalize an option like that because I had this problem before and I've tried to hide the elements with CSS setting visible:hidden and the performance is the same as with visible children elements, although there is performance improvements when use display:none, at the same time it could breaks the height of the dialog,
therefore dragHelper was one solution to get these results, with this option we can let the user move a helper element instead of the original dialog DOM element.
On Tue, Feb 24, 2009 at 5:40 PM, Eduardo Lundgren <eduardo...@gmail.com> wrote:
Hi Richard,
I mentioned thousands but hundreds are enough to cause the delay.
Still not seeing this as a common case. Do you have a real-world example? And I'm talking about an example that's going to fit in the 80-95% of use cases. If we try to handle that last 5% in each plugin, it will surely lead to bloat.
I like the idea of externalize an option like that because I had this problem before and I've tried to hide the elements with CSS setting visible:hidden and the performance is the same as with visible children elements, although there is performance improvements when use display:none, at the same time it could breaks the height of the dialog,
In that case, simply set the dialog height on dragStart, and reset it on dragStop. Like so:
$("#dialog").dialog({
dragStart: function() { $(this).dialog("option", "height", $(this).parents(".ui-dialog").height()).hide(); },
dragStop: function() { $(this).dialog("option", "height", "auto").show(); }
});
What about the Ext.Window example ? That represents a very common usecase - dialog using empty helper.
This is a good solution. Although, this two lines of code aren't simple as using the option dragHelper and it also doesn't give the user the possibility to use a different element to be the helper instead of the original, with the dragHelper option you can do both possibilities.
It's represents the jQuery UI components integration, one component taking advantage from another component option, in this case the dialog using the draggable helper option.
We can link the dragHelper documentation with the ui.draggable helper option documentation, by this way, the user can figure out how this helper works looking at the ui.draggable helper documentation ( http://docs.jquery.com/UI/Draggable#option-helper ).
On Tue, Feb 24, 2009 at 9:51 PM, Richard D. Worth <rdw...@gmail.com> wrote:On Tue, Feb 24, 2009 at 5:40 PM, Eduardo Lundgren <eduardo...@gmail.com> wrote:
Hi Richard,
I mentioned thousands but hundreds are enough to cause the delay.
Still not seeing this as a common case. Do you have a real-world example? And I'm talking about an example that's going to fit in the 80-95% of use cases. If we try to handle that last 5% in each plugin, it will surely lead to bloat.
What about the Ext.Window example ? That represents a very common usecase - dialog using empty helper.
I like the idea of externalize an option like that because I had this problem before and I've tried to hide the elements with CSS setting visible:hidden and the performance is the same as with visible children elements, although there is performance improvements when use display:none, at the same time it could breaks the height of the dialog,
In that case, simply set the dialog height on dragStart, and reset it on dragStop. Like so:
$("#dialog").dialog({
dragStart: function() { $(this).dialog("option", "height", $(this).parents(".ui-dialog").height()).hide(); },
dragStop: function() { $(this).dialog("option", "height", "auto").show(); }
});
This is a good solution. Although, this two lines of code aren't simple as using the option dragHelper and it also doesn't give the user the possibility to use a different element to be the helper instead of the original, with the dragHelper option you can do both possibilities.
It's represents the jQuery UI components integration, one component taking advantage from another component option, in this case the dialog using the draggable helper option.
We can link the dragHelper documentation with the ui.draggable helper option documentation, by this way, the user can figure out how this helper works looking at the ui.draggable helper documentation ( http://docs.jquery.com/UI/Draggable#option-helper ).
It's a common option in another frameworks and it seems very useful, on EXT JS Framework the Ext.Window has an option called "plain":plain : Boolean( http://extjs.com/deploy/dev/docs/?class=Ext.Window ).True to render the window body with a transparent background so that it will blend into the framing elements, false to add a lighter background color to visually highlight the body element and separate it more distinctly from the surrounding frame (defaults to false).
On Tue, Feb 24, 2009 at 10:26 PM, Scott González <scott.g...@gmail.com> wrote:
On Tue, Feb 24, 2009 at 5:40 PM, Eduardo Lundgren <eduardo...@gmail.com> wrote:Is this the real use case? Could we add an option that does this as opposed to a direct pass-through of draggable's helper option? A boolean that clears the contents and adds a class would be much more reasonable to expose as an option (though as I said before I haven't seen this in anything I've used).It's a common option in another frameworks and it seems very useful, on EXT JS Framework the Ext.Window has an option called "plain":plain : Boolean( http://extjs.com/deploy/dev/docs/?class=Ext.Window ).True to render the window body with a transparent background so that it will blend into the framing elements, false to add a lighter background color to visually highlight the body element and separate it more distinctly from the surrounding frame (defaults to false).
I'd prefer to simply add .ui-dialog-dragging (see the first message in this thread) and then use css to hide the content
.ui-dialog-dragging .ui-dialog-content { display: none; }
Then we could have dialog automatically (and always) maintain the height of the dialog during drag. No option, nothing for the user to do except add the css line above. Which says exactly what it does (even a lot better than the two lines of javascript I wrote earlier): while a dialog is being dragged, hide its content. This also provides all the unlimited flexibility for displaying other content in its place, changing the background color, the opacity, the border, etc. And it's consistent with ui-draggable-dragging and ui-dialog-resizing (again, see first message in this thread).
- Richard
I'd prefer to simply add .ui-dialog-dragging (see the first message in this thread) and then use css to hide the content
.ui-dialog-dragging .ui-dialog-content { display: none; }
Then we could have dialog automatically (and always) maintain the height of the dialog during drag. No option, nothing for the user to do except add the css line above. Which says exactly what it does (even a lot better than the two lines of javascript I wrote earlier): while a dialog is being dragged, hide its content. This also provides all the unlimited flexibility for displaying other content in its place, changing the background color, the opacity, the border, etc. And it's consistent with ui-draggable-dragging and ui-dialog-resizing (again, see first message in this thread).
The idea is the goal here, I vote in keep it as simple as possible and for me option is better for this case.
Although, if the result is increase the performance and keep the empty helper whatever solution is welcome.
What we can't is remove the possibility.
Like this very much indeed. Makes a lot more sense to modify look and feel during an event via css than through js. Could we also have a .ui-dialog-resizing added as well?
Like this very much indeed. Makes a lot more sense to modify look and feel during an event via css than through js. Could we also have a .ui-dialog-resizing added as well?
I disagree. I want dialogs, but without a titlebar or close button as
part of the dialog. For close I have form-buttons inside the dialog,
and a title bar serves no useful purpose most of the time.
Wichert.
--
Wichert Akkerman <wic...@wiggy.net> It is simple to make things.
http://www.wiggy.net/ It is hard to make things simple.
Previously Richard D. Worth wrote:I disagree. I want dialogs, but without a titlebar or close button as
> If you want a dialog, it means you're looking for a titlebar, a close
> button, maybe some buttons at the bottom.
part of the dialog. For close I have form-buttons inside the dialog,
a title bar serves no useful purpose most of the time.
- overlay
- positioning
- sizing
some of those can be simplified - currently the plugin tries hard to set
inline styles for things that can be done with a few CSS rules.
> Without a titlebar, where would it be draggable by? That's the whole point
> of most of this thread - draggable dialogs that are dragged around by their
> titlebar. Same as most all windows in most OS window managers. Seems a
> pretty useful purpose to me. That and displaying the title.
That quickly leads you to the insanity that is ExtJS, which last time I
looked created 14 nested divs just to create a table since their entire
model is based on the idea that everything should be resizable,
draggable and act like a OS-level window in all aspects.
jQuery has always tried to do the exact opposite: do as little as
possible and do it well. I think that applies here as well.
For non-modal dialogs I can see the point of having them be draggable.
For modal dialogs I can not imagine a sensible use case where you want
that.
- overlay
Previously Richard D. Worth wrote:
> On Wed, Feb 25, 2009 at 4:49 AM, Wichert Akkerman <wic...@wiggy.net> wrote:
>
> > Previously Richard D. Worth wrote:
> > > If you want a dialog, it means you're looking for a titlebar, a close
> > > button, maybe some buttons at the bottom.
> >
> > I disagree. I want dialogs, but without a titlebar or close button as
> > part of the dialog. For close I have form-buttons inside the dialog,
> >
>
> This is my point exactly. If this is what you want, it's possible you want
> something other than a jQuery UI Dialog. I was attempting to describe the
> main features of the dialog plugin that separate it from
>
> $("#myDiv").draggable().resizable();
- positioning
- sizing
some of those can be simplified - currently the plugin tries hard to set
inline styles for things that can be done with a few CSS rules.
> Without a titlebar, where would it be draggable by? That's the whole pointThat quickly leads you to the insanity that is ExtJS, which last time I
> of most of this thread - draggable dialogs that are dragged around by their
> titlebar. Same as most all windows in most OS window managers. Seems a
> pretty useful purpose to me. That and displaying the title.
looked created 14 nested divs just to create a table since their entire
model is based on the idea that everything should be resizable,
draggable and act like a OS-level window in all aspects.
jQuery has always tried to do the exact opposite: do as little as
possible and do it well. I think that applies here as well.
For non-modal dialogs I can see the point of having them be draggable.
For modal dialogs I can not imagine a sensible use case where you want
that.