![JAR search and dependency download from the Maven repository](/logo.png)
scales.query.NodeProvider.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of scales_2.11 Show documentation
Show all versions of scales_2.11 Show documentation
A Web Component based UI framework written in Scala.js.
The newest version!
package scales.query
import org.scalajs.dom.{ Element, Node, NodeSelector }
import org.scalajs.dom.ext.PimpedNodeList
trait NodeProvider[A <: NodeSelector] {
def contentRoot: A
def querySelector[T <: Element](selectors: String): Option[T] = {
require(selectors != null, "Missing argument 'selectors'.")
val result = Option(contentRoot.querySelector(selectors))
result.map(_.asInstanceOf[T])
}
def querySelectorAll[T <: Element](selectors: String): Seq[T] = {
require(selectors != null, "Missing argument 'selectors'.")
val result: Seq[Node] = contentRoot.querySelectorAll(selectors)
result.map(_.asInstanceOf[T]).toSeq
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy