Permalink
Browse files

nav file checked and jslint gone

  • Loading branch information...
1 parent 0361215 commit 9cd69ca7a7a52704c454d62400c0adafacc38fe9 @chetanankola committed Sep 9, 2012
View
Binary file not shown.
@@ -0,0 +1,45 @@
+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({
+ type: name,
+
+ on: function (node, sub, notifier, filter) {
+ var method = (filter) ? 'delegate' : 'on';
+
+ sub._handle = node[method]('keydown', function (e) {
+ if (e.keyCode === keyCode) {
+ notifier.fire(e);
+ }
+ }, filter);
+ },
+
+ delegate: function () {
+ this.on.apply(this, arguments);
+ },
+
+ detach: function (node, sub) {
+ sub._handle.detach();
+ },
+
+ detachDelegate: function () {
+ this.detach.apply(this, arguments);
+ }
+ });
+});
+
+
+}, '@VERSION@' ,{requires:['event-synthetic']});
Oops, something went wrong.

0 comments on commit 9cd69ca

Please sign in to comment.