forked from yui/yui3-gallery
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gallery Build Tag: gallery-2010.03.02-18
- Loading branch information
YUI Builder
committed
Mar 2, 2010
1 parent
1869428
commit 9b0cb90
Showing
14 changed files
with
937 additions
and
400 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
build/gallery-event-nav-keys/gallery-event-nav-keys-debug.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
YUI.add('gallery-event-nav-keys', function(Y) { | ||
|
||
var keys = { | ||
enter : 13, | ||
esc : 27, | ||
backspace: 8, | ||
tab : 9, | ||
pageUp : 33, | ||
pageDown : 34, | ||
left : 37, | ||
up : 38, | ||
right : 39, | ||
down : 40 | ||
}; | ||
|
||
Y.Object.each( keys, function ( keyCode, name ) { | ||
Y.Event.define( name, { | ||
publishConfig: { emitFacade: false }, | ||
|
||
on: function ( node, sub, ce ) { | ||
sub._evtGuid = Y.guid() + '|'; | ||
|
||
node.on( sub._evtGuid + 'keydown', function ( e ) { | ||
if ( e.keyCode === keyCode ) { | ||
e.type = name; | ||
ce.fire( e ); | ||
} | ||
}); | ||
}, | ||
|
||
detach: function (node, sub, ce) { | ||
node.detach(sub._evtGuid + '*'); | ||
} | ||
} ); | ||
} ); | ||
|
||
Y.Event.define( 'arrow', { | ||
publishConfig: { emitFacade: false }, | ||
|
||
on: function ( node, sub, ce ) { | ||
var directions = this._directions; | ||
|
||
sub._evtGuid = Y.guid() + '|'; | ||
|
||
node.on( 'keydown', function ( e ) { | ||
if ( e.keyCode > 36 && e.keyCode < 41 ) { | ||
e.originalType = e.type; | ||
e.type = 'arrow'; | ||
e.direction = directions[ e.keyCode ]; | ||
|
||
ce.fire( e ); | ||
} | ||
} ); | ||
}, | ||
|
||
detach: function ( node, sub, ce ) { | ||
node.detach( sub._evtGuid + '*' ); | ||
}, | ||
|
||
_directions: { | ||
37: 'left', | ||
38: 'up', | ||
39: 'right', | ||
40: 'down' | ||
} | ||
} ); | ||
|
||
|
||
}, 'gallery-2010.03.02-18' ,{requires:['event-synthetic']}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.