Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Make shortcut keys work.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Feb 22, 2009
1 parent d0ae004 commit 74ed400
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -57,8 +57,9 @@ var MooEditable = new Class({
this.actions = this.options.actions.clean().split(' ');
this.keys = {};
this.actions.each(function(action){
if (!MooEditable.Actions[action]) return;
var key = MooEditable.Actions[action]['shortcut'];
var act = MooEditable.Actions[action];
if (!act) return;
var key = act.options.shortcut;
if (key) this.keys[key] = action;
}.bind(this));
this.render();
Expand Down Expand Up @@ -231,8 +232,8 @@ var MooEditable = new Class({

keyListener: function(e){
if (!e.control || !this.keys[e.key]) return;
e.stop();
this.action(this.keys[e.key]);
var item = this.toolbar.getItem(this.keys[e.key]);
item.action(e);
},

enterListener: function(e){
Expand Down

0 comments on commit 74ed400

Please sign in to comment.