Skip to content
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

Up and Running/ Tour Libs / HTML / considering adding to the remarks on Hide Elements example #19049

Closed
DartBot opened this issue May 27, 2014 · 7 comments
Assignees

Comments

@DartBot
Copy link

DartBot commented May 27, 2014

This issue was originally filed by NetaisLL...@gmail.com


URL: https://www.dartlang.org/docs/dart-up-and-running/contents/ch03.html#ch03-manipulating-the-dom

Issue/feedback:

    The code example wherein elements are hidden/shown based on the
    OS of the platform is super cool.

    However, it took me a few minutes to grok the use of the CSS selector
    ".$os". I assume it is a use of Dart's string interpolation.

    I think the example would benefit from a small comment that
    points that out.

    Maybe coming from JavaScript as I am got in the way...:(


Attachment:
[5-27-2014 2-04-09 PM.jpg](https://storage.googleapis.com/google-code-attachments/dart/issue-19049/comment-0/5-27-2014 2-04-09 PM.jpg) (98.02 KB)

@kwalrath
Copy link
Contributor

Set owner to @kwalrath.
Added Docs-UpAndRunning label.

@kwalrath
Copy link
Contributor

kwalrath commented Jun 4, 2014

Removed Area-Documentation label.
Added Area-Site label.

@kwalrath
Copy link
Contributor

kwalrath commented Aug 8, 2014

How about changing it to this:

  // Find all elements with class=os. Note the string interpolation with $os.
  // If os is 'windows', the method call becomes querySelectorAll('.windows').
  for (var elem in querySelectorAll('.$os')) {
    elem.hidden = !shouldShow; // Show or hide each element.


Added Started label.

@kwalrath
Copy link
Contributor

kwalrath commented Aug 8, 2014

Or maybe:

  // Find all elements with class=os. For example, if os == 'windows', call
  // querySelectorAll('.windows') to find all elements with the class "windows".
  for (var elem in querySelectorAll('.$os')) { // $os does string interpolation
    elem.hidden = !shouldShow; // Show or hide each element.
  }

@kwalrath
Copy link
Contributor

kwalrath commented Aug 8, 2014

@kwalrath
Copy link
Contributor

Added Fixed label.

@nicolasgarnier
Copy link
Contributor

This issue has been moved to Github as part of a migration. Please use the Issue on Github going forward: https://github.com/dart-lang/dartlang.org/issues

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants