Skip to content
This repository has been archived by the owner on Aug 24, 2023. It is now read-only.

Commit

Permalink
updating guide to be uniquely generated for simples
Browse files Browse the repository at this point in the history
  • Loading branch information
thomcowell committed Jan 5, 2012
1 parent 83f4013 commit 95bde49
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Simples.merge( /** @lends Simples */ {
events = data.events ? data.events : data.events = {},
handlers = data.handlers ? data.handlers : data.handlers = {};

var guid = !callback.guid ? callback.guid = Simples.guid++ : callback.guid,
var guid = !callback.guid ? callback.guid = "simples-guid-" + Simples.guid++ : callback.guid,
handler = handlers[ type ];

if( !handler ){
Expand Down
2 changes: 1 addition & 1 deletion test/events.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ test("bind() and unbind() setup data correctly", 5, function() {
};

Simples("#firstp").bind( "click", callback );
same( callback.guid, Simples.guid - 1, "should have the guid set" );
same( callback.guid, "simples-guid-" + (Simples.guid - 1), "should have the guid set" );
ok( !!Simples.data( Simples("#firstp")[0], "handlers").click, 'should attach handler function to function' );
same( Simples.data( Simples("#firstp")[0], "events").click, [ {callback: callback, guid: callback.guid }],"Event handler bound correctly." );

Expand Down

0 comments on commit 95bde49

Please sign in to comment.