Skip to content

Cannot use a custom jQuery instance #21

Description

@ebruchez

object JQueryStatic maps to a global jQuery object.

I use jQuery.noConflict() to scope a specific version of jQuery. So I don't think I can use JQueryStatic as is.

Maybe splitting it into a trait and an object could help:

trait JQueryStatic { ... }

object JQueryStatic extends JQueryStatic

With the regular org.scalajs.jquery.JQueryStatic from scala-js/scala-js-jquery, which is a trait, I can do just that:

val $ = g.MY.jQuery.asInstanceOf[org.scalajs.jquery.JQueryStatic]

See also how a default scala-js/scala-js-jquery scopes a default org.scalajs.jquery.JQueryStatic here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions