madrobby / scripty2

scripty2: for a more delicious web
http://scripty2.com/
Other
516 stars 57 forks source link

Cannot pass button options to dialog buttons #23

Open colinmollenhour opened 13 years ago

colinmollenhour commented 13 years ago

Simple solution: if a button "options" property exists then pass it to the UI.Button constructor. Resulting example for API would be something like:

new S2.UI.Dialog({
   ...,
   buttons:[ {
      primary:true,
      label:'OK',
      action:someAction,
      options:{icons:{primary:'ui-icon-check'}}
   } ]
}
justinbaker999 commented 13 years ago

Doesn't it already do that? https://github.com/madrobby/scripty2/blob/master/src/ui/controls/dialog.js#L169

colinmollenhour commented 13 years ago

No: https://github.com/madrobby/scripty2/blob/master/src/ui/controls/dialog.js#L192 I'm essentially talking about changing that line to: new UI.Button(element,button.options || {});