Skip to content

Dialog: Document button pass-thru options #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

scottgonzalez
Copy link
Member

Fixes gh-208

@tjvantoll
Copy link
Member

It's text and not showText. Also I think an example would help a lot here, as this is tricky to mentally parse regardless of how it's worded. It could be as simple as adding, “for example, $( "selector" ).dialog({ buttons: [{ text: "Favorite", icons: { primary: "ui-icon-heart" } }] })”.

@scottgonzalez
Copy link
Member Author

It's text and not showText.

The key in the object is showText because text controls the actual text (label) of the button. See https://github.com/jquery/jquery-ui/blob/6a242ab4ebdcec265826b959fa27881dcf462c96/ui/dialog.js#L478-L481

Also I think an example would help a lot here, as this is tricky to mentally parse regardless of how it's worded.

Agreed. I'll add a demo and we can do another round of review.

@tjvantoll
Copy link
Member

The key in the object is showText because text controls the actual text (label) of the button. See https://github.com/jquery/jquery-ui/blob/6a242ab4ebdcec265826b959fa27881dcf462c96/ui/dialog.js#L478-L481

AH the boolean text option. I get it now. I think this is another one where an example will help.

@scottgonzalez
Copy link
Member Author

@tjvantoll I made it possible to have multiline examples (already landed in master) and then updated the example here.

@tjvantoll
Copy link
Member

Awesome, this is great. One trivial nit: do you know why the tabs used the source end up being converted into two spaces in the output?

@scottgonzalez
Copy link
Member Author

do you know why the tabs used the source end up being converted into two spaces in the output?

We do that on all syntax highlighted code samples across all sites. I believe we decided to do this to help avoid horizontal scrolling.

@kswedberg
Copy link
Member

@tjvantoll, my memory on that aligns with what @scottgonzalez said. Especially on smaller devices, code samples quickly become cumbersome to read when they're indented with tabs. Seems like converting to spaces is the best option, at least until IE supports the tab-size CSS property (which it doesn't as of IE11, apparently).

scottgonzalez added a commit that referenced this pull request Jan 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Dialog: Extend buttons option docs to cover icons or other button widget options
3 participants