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

Commit

Permalink
Move up the keys array.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Feb 19, 2009
1 parent 5ad451f commit db6f9d5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -116,6 +116,13 @@ var MooEditable = new Class({
if (self.mode == 'iframe') self.saveContent();
});
}

this.keys = {};
this.actions.each(function(action){
if (!MooEditable.Actions[action]) return;
var key = MooEditable.Actions[action]['shortcut'];
if (key) self.keys[key] = action;
});
},

attach: function(){
Expand Down Expand Up @@ -161,12 +168,6 @@ var MooEditable = new Class({
$(this.doc.body);

// Bind keyboard shortcuts
this.keys = {};
this.actions.each(function(action){
if (!MooEditable.Actions[action]) return;
var key = MooEditable.Actions[action]['shortcut'];
if (key) self.keys[key] = action;
});
this.doc.addEvents({
keypress: this.keyListener.bind(this),
keydown: this.enterListener.bind(this)
Expand Down

0 comments on commit db6f9d5

Please sign in to comment.