GitXplorerGitXplorer
b

dojo-on

public
5 stars
0 forks
1 issues

Commits

List of commits on branch master.
Unverified
1f0cc62f79849f397a46487764c52c9adf27b1bf

add eat and fix up docs a bit

bblowery committed 14 years ago
Unverified
e7e448ff3b4a2ba3122bd1aaf7d6057dba94bf7e

readme

bblowery committed 14 years ago
Unverified
5e44741a709a18f65e4590db2178dba0ae660ce6

initial commit

bblowery committed 14 years ago

README

The README file for this repository.

h1. dojo.on()

p. A simple Dojo plugin to enable an easier to read format for dojo.connect.


  // before
  var handle = dojo.connect(dojo.byId("someNode"), "click", function(evt) {
    evt.preventDefault();
    dojo.style(evt.currentTarget, "color", "red");
  });
  
  dojo.disconnect(handle);
  
  // with dojo.on()
  
  dojo.on("someNode", "click")
    .prevent()
    .then(function(evt){
      dojo.style(evt.currentTarget, "color", "red");
    })
    .disconnect();
    
  // with dojo.eat() and some friends
  // dojo.eat() is just like dojo.on().prevent()
  
  dojo.eat("someNode", "click")
      .then(function(evt) { 
        dojo.style(evt.currentTarget, "color", "red"); 
      })
      .disconnect();