Skip to content

Simplify typeset function. #557

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

Merged
merged 3 commits into from
May 3, 2016
Merged

Conversation

afshin
Copy link
Contributor

@afshin afshin commented May 3, 2016

The typeset function can be dramatically simplified because we do not pass element collections to it. It was implemented to support collections because it was ported over from a jQuery implementation and jQuery objects are collections by default. But it is not necessary in the current codebase.

cf. #544

cc: @jasongrout @SylvainCorlay

@afshin afshin changed the title Simply typeset function. Simplify typeset function. May 3, 2016
@sccolbert
Copy link

The docs for this function should be update to explain the new call signature.

} else {
element.textContent = text;
}
if (text) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's unconditionally set the text. Suppose I have a label widget which sets the content based on a text string coming from python. If the user for whatever reason sets the content to '', this function will now keep the original text since '' is false in Javascript.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or even better, we can keep it optional, but explicitly check to see if text is undefined.

@afshin
Copy link
Contributor Author

afshin commented May 3, 2016

@jasongrout 👍

@jasongrout
Copy link
Member

Thanks!

@jasongrout jasongrout merged commit c5ef4b9 into jupyter-widgets:master May 3, 2016
@SylvainCorlay
Copy link
Member

👍
On May 3, 2016 5:30 PM, "Jason Grout" [email protected] wrote:

Merged #557 #557.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#557 (comment)

@jasongrout jasongrout added this to the Previous Releases milestone Nov 17, 2017
@github-actions github-actions bot added the resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion. label Feb 9, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-locked Closed issues are locked after 30 days inactivity. Please open a new issue for related discussion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants