8000 GitHub - andrienko/shred: Tiny component definition
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

andrienko/shred

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Shred

Shred is just my snippet for organizing code into modules for usage with jQuery/Zepto

var Checkbox = Shred.extend(
  {
    state: { value: false },
    init: function(body, component){
      body
        .addClass('control-checkbox')
        .click(function(){
        component.state('value', !component.state('value'));
      });
    },
    render: function(body){
      body
        .append($('<span class="box"/>').toggleClass('checked',this.state('value')));
    }
  }
);

... a-and, then you add some CSS and you're good to go.

This is not a LIBRARY.

This may and will change in the future. Take it or leave it.

About

Tiny component definition

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0