not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
756 B

  1. /**
  2. A box that shows or hides a check mark when clicked.
  3. The onChange event is fired when it is clicked. Use getValue() to fetch
  4. the checked status.
  5. {kind: "onyx.Checkbox", onchange: "checkboxClicked"}
  6. checkboxClicked: function(inSender) {
  7. if (inSender.getValue()) {
  8. this.log("I've been checked!");
  9. }
  10. }
  11. */
  12. enyo.kind({
  13. name: "onyx.Checkbox",
  14. classes: "onyx-checkbox",
  15. //* @protected
  16. kind: enyo.Checkbox,
  17. tag: "div",
  18. handlers: {
  19. ondown:"downHandler",
  20. // prevent double onchange bubble in IE
  21. onclick: ""
  22. },
  23. downHandler: function(inSender, e) {
  24. if (!this.disabled) {
  25. this.setChecked(!this.getChecked());
  26. this.bubble("onchange");
  27. }
  28. return true;
  29. },
  30. tap: function(inSender, e) {
  31. return !this.disabled;
  32. }
  33. });