Skip to content

Commit

Permalink
Merge pull request #3 from mbrowne/master
Browse files Browse the repository at this point in the history
Updated readme and test.html
  • Loading branch information
markdalgleish committed Dec 27, 2012
2 parents 32c9a56 + 2ca1698 commit c3172e4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
15 changes: 15 additions & 0 deletions README.md
Expand Up @@ -41,6 +41,21 @@ Gallery.prototype = {
};
```

Note: While generally discouraged, it's possible to use inline functions or function variables rather
a string with the function name. This may be useful for classes that consist almost entirely of event handlers,
or for event handlers with only a couple lines of code. For example:

``` js
Gallery.prototype = {
events: {
'dblclick img' : function() { ... },
...
}
...
}
```


Keyboard events made easy.
--------------------------

Expand Down
4 changes: 2 additions & 2 deletions test/test.html
Expand Up @@ -41,7 +41,7 @@ <h1>Eventralize Tests</h1>
$(function(){
var TEST = {
events: {
'click button.a, click button.b, click button.c' : 'turnRed',
'click button.a, click button.b, click button.c' : 'turnGreen',
'keydown(shift+4) document' : 'testKeys',
'click button.unbind' : 'unbind'
},
Expand All @@ -53,7 +53,7 @@ <h1>Eventralize Tests</h1>
unbind: function() {
this.$elem.uneventralize(this.events, 'test');
},
turnRed: function(event) {
turnGreen: function(event) {
$(event.currentTarget).css('background-color', 'green');
},
testKeys: function() {
Expand Down

0 comments on commit c3172e4

Please sign in to comment.