Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. class Component extends React.Component {
  2. _bind(...methods) {
  3. methods.forEach((method) => this[method] = this[method].bind(this));
  4. }
  5. }
  6.  
  7. class UserSettings extends Component {
  8. constructor() {
  9. super();
  10.  
  11. this._bind("toggleSound", "toggleVibrate");
  12. }
  13.  
  14. toggleSound() {
  15. console.log("Sound Toggle");
  16. }
  17.  
  18. toggleVibrate() {
  19.  
  20. }
  21.  
  22. render() {
  23. return (
  24. <span>
  25. <ul className="links">
  26. <li onClick={this.toggleSound}>
  27. <a href="javascript:{}">Sound&emsp;<i className={"right fa " + (false ? "fa-check-square-o" : "fa-square-o")}></i></a>
  28. </li>
  29. <li onClick={this.toggleVibrate}>
  30. <a href="javascript:{}">Vibration&emsp;<i className={"right fa " + (false ? "fa-check-square-o" : "fa-square-o")}></i></a>
  31. </li>
  32. </ul>
  33. <a href="javascript:{}" onClick={this.toggleSound.bind(this)}>Test</a>
  34. </span>
  35. );
  36. }
  37. }
  38.  
  39. ReactDOM.render(<UserSettings />, document.getElementById("nav"));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement