Requires

Provides

Checkbox.js

Two-state command (can be on and off)

License:
Public domain (http://unlicense.org).
Authors:
Yaroslaff Fedin

Checkbox commands are useful when you need to track and toggle state of some linked object.

Provide your custom logic hooking on check and uncheck state transitions. Use checked property to get the current state.

Examples: – Button that toggles visibility of a sidebar – Context menu item that shows or hides line numbers in editor

  1. 34
  2. 35
  3. 36
  4. 37
  5. 38
  6. 39
  7. 40
  8. 41
  9. 42
  10. 43
  11. 44
  12. 45
LSD.Command.Checkbox = new Class({ Extends: LSD.Command, options: { states: Array.fast('checked') }, click: function() { this.parent.apply(this, arguments); this.toggle(); } });