-
Notifications
You must be signed in to change notification settings - Fork 949
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
Conversation
The docs for this function should be update to explain the new call signature. |
} else { | ||
element.textContent = text; | ||
} | ||
if (text) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Thanks! |
👍
|
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 ajQuery
implementation andjQuery
objects are collections by default. But it is not necessary in the current codebase.cf. #544
cc: @jasongrout @SylvainCorlay