Skip to content

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()
}
} No newline at end of file
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.

3 participants