Dialog Buttons - Primary, Secondary, Disabled
The new CSS framework supports primary, secondary and disabled buttons. However, there is currently no way to set these properties on buttons added to dialogs.
The current implementation is:
$(el).dialog({
buttons: {
foo: function() {},
bar: function() {},
baz: function() {}
}
});
We should probably expand this to allow you to set additional properties on the buttons:
$(el).dialog({
buttons: {
foo: {
priority: 'primary',
enabled: true,
callback: function() {}
},
bar: {
priority: 'secondary',
enabled: true,
callback: function() {}
},
baz: {
priority: 'secondary',
enabled: false,
callback: function() {}
},
}
});
We would have defaults:
type: secondary
enabled: true
We could also support the current and new syntax simultaneously:
$(el).dialog({
buttons: {
foo: {
priority: 'primary',
callback: function() {}
},
bar: function() {},
baz: {
enabled: false,
callback: function() {}
},
}
});
Questions:
Should there always be a primary button?
Should pressing enter on a field that would normally submit perform the primary button's action?
Should we support differentiating between primary and default? I personally find this behavior extremely annoying in OS X.