Skip to content

Example application based on this wrapper; Closes #7 #8

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

Merged
merged 1 commit into from
Apr 12, 2016
Merged

Conversation

Starzu
Copy link
Contributor

@Starzu Starzu commented Apr 7, 2016

@malcheg take a look.

@malcheg
Copy link

malcheg commented Apr 8, 2016

@Starzu please check JQueryCallbacks trait, i think empty() method should be wrapped there.

@malcheg
Copy link

malcheg commented Apr 8, 2016

@Starzu, i can't find then() method in JqueryPromise or JQueryDeferred traits, check it please
https://api.jquery.com/deferred.then/

)
}).change()
}
}
Copy link

Choose a reason for hiding this comment

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

I think we need to show how attr() method works by changing data-checked attr:

override protected val content = div(cls := "demo")(
    h3(".attr() & .prop()"),
    input(id := "check1", tpe := "checkbox", checked := "checked"),
    label(`for` := "check1")("Check me"),
    p(),
    button(onclick :+= ((_: Event) => {
      jQ(".demo input").attr("data-checked", "checked").change()
      false
    }))(".attr(\"data-checked\", \"checked\")"),
    button(onclick :+= ((_: Event) => {
      jQ(".demo input").attr("data-checked", "").change()
      false
    }))(".attr(\"data-checked\", \"\")"), br(),
    button(onclick :+= ((_: Event) => {
      jQ(".demo input").prop("checked", true).change()
      false
    }))(".prop(\"checked\", true)"),
    button(onclick :+= ((_: Event) => {
      jQ(".demo input").prop("checked", false).change()
      false
    }))(".prop(\"checked\", false)")
  ).render

  override protected val script = () => {
    jQ(".demo input").change((input: Element, _: JQueryEvent) => {
      jQ(".demo p").html(
        s""".attr('data-checked'): ${jQ(input).attr("data-checked")}<br/>
           |.prop('checked'): ${jQ(input).prop("checked")}<br/>
           |.is(':checked'): ${jQ(input).is(":checked")}""".stripMargin
      )
    }).change()
  }

@Starzu
Copy link
Contributor Author

Starzu commented Apr 11, 2016

@malcheg take a look again.

@malcheg
Copy link

malcheg commented Apr 11, 2016

it's ok now

* Improvements of the types in the wrapper
@Starzu Starzu merged commit c21fc49 into master Apr 12, 2016
@Starzu Starzu deleted the example branch April 12, 2016 08:09
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

Successfully merging this pull request may close these issues.

2 participants