Skip to content

Add JS DOM utils to Scaladoc-js - #14595

Merged
pikinier20 merged 2 commits into
scala:mainfrom
dotty-staging:scaladoc/js-html-utils
Mar 9, 2022
Merged

Add JS DOM utils to Scaladoc-js#14595
pikinier20 merged 2 commits into
scala:mainfrom
dotty-staging:scaladoc/js-html-utils

Conversation

@pikinier20

Copy link
Copy Markdown
Contributor

No description provided.

@pikinier20
pikinier20 force-pushed the scaladoc/js-html-utils branch from 1faf597 to 39e3fcf Compare March 2, 2022 10:48
val testId = Attr("data-test-id")
val alt = Attr("alt")
val value = Attr("value")
val onclick=Attr("onclick")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

format

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

also: i'd use onClick

val b = Tag[domhtml.Element]("b")
val i = Tag[domhtml.Element]("i")

val cls = Attr("class")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

class, we do not code in C++ to count every character we type

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

class is a keyword and I didn't want to type:

`class`

in every tag

case _ =>
}
div.style = "display:none;"
bdiv.style = "display:none;"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couldnt be this event listerner block inlined in exitButton using tap?

import org.scalajs.dom.html.Input
import scala.scalajs.js.timers._
import scala.concurrent.duration._
import scala.concurrent.duration.{span => dspan, _}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dspan seems unused. Can we just import things we need or import span => _?

@pikinier20
pikinier20 merged commit 99c2b96 into scala:main Mar 9, 2022
@pikinier20
pikinier20 deleted the scaladoc/js-html-utils branch March 9, 2022 08:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants