Dialog Buttons - Primary, Secondary, Disabled - part 2

17 views
Skip to first unread message

Andreas

unread,
Apr 28, 2009, 9:16:27 AM4/28/09
to jQuery UI Development
Part 1: http://groups.google.com/group/jquery-ui-dev/browse_thread/thread/fa48f0eee0e27ee1
Trac ticket: http://dev.jqueryui.com/ticket/4344

Since the first thread is locked, probably by inactivity Im starting a
new, on request.

I've uploaded 2 patches on the ticket, Id like people to review both
of them and find out which of them you like the most. I didnt do any
unit test yet but I plan to do it when we agreed on which patch to go
with or even work out a new solution.

Example HTML:
http://dpaste.com/hold/38759/

Jörn Zaefferer

unread,
Apr 28, 2009, 3:51:37 PM4/28/09
to jquery...@googlegroups.com
Using an object to specify a list of buttons makes it difficult to
localize the title. Consider this example:

buttons: {
// invalid syntax
[messages.primaryButton]: { ...}
}

Instead you have to split that:

var buttons = {};
buttons[primaryButton] = { ... }
[...]
buttons: buttons, ...

Using an array, you could do:

buttons: [
{
title: message.primaryButton,
click: function() { ... }
},
{ ... }
]

And it would be clear that the buttons are ordered.

Jörn

Andreas

unread,
May 12, 2009, 9:47:39 AM5/12/09
to jQuery UI Development
I completly agree. I stumbled upon this this week aswell.
Would be much nicer if there was a better way to localize the button
texts.

Though it would require backwards incompatible changes. I dont know
how the core team feels about that.


On Apr 28, 9:51 pm, Jörn Zaefferer <joern.zaeffe...@googlemail.com>
wrote:
> Using an object to specify a list of buttons makes it difficult to
> localize the title. Consider this example:
>
> buttons: {
>   // invalid syntax
>   [messages.primaryButton]: { ...}
>
> }
>
> Instead you have to split that:
>
> var buttons = {};
> buttons[primaryButton] = { ... }
> [...]
> buttons: buttons, ...
>
> Using an array, you could do:
>
> buttons: [
>   {
>     title: message.primaryButton,
>     click: function() { ... }
>   },
>   { ... }
> ]
>
> And it would be clear that the buttons are ordered.
>
> Jörn
>
> On Tue, Apr 28, 2009 at 3:16 PM, Andreas <andr...@klydd.se> wrote:
>
> > Part 1:http://groups.google.com/group/jquery-ui-dev/browse_thread/thread/fa4...
Reply all
Reply to author
Forward
0 new messages