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

Commit

Permalink
No need to always clean and split the 'actions' string, again and again.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Feb 15, 2009
1 parent 164e0ae commit c3f72ec
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -65,6 +65,8 @@ var MooEditable = new Class({
render: function(){
var self = this;

this.actions = this.options.actions.clean().split(' ');

// Build the container
this.container = new Element('div', {
id: (this.textarea.id) ? this.textarea.id + '-container' : null,
Expand Down Expand Up @@ -163,7 +165,7 @@ var MooEditable = new Class({

// Bind keyboard shortcuts
this.keys = {};
this.options.actions.clean().split(' ').each(function(action){
this.actions.each(function(action){
if (!MooEditable.Actions[action]) return;
var key = MooEditable.Actions[action]['shortcut'];
if (key) self.keys[key] = action;
Expand Down Expand Up @@ -688,13 +690,12 @@ MooEditable.UI.Toolbar= new Class({
},

render: function(){
this.actions = this.editor.options.actions.clean().split(' ');
if (this.items.length){
this.items.each(function(item){
$(item).inject(this.el);
}.bind(this));
} else {
this.actions.each(this.add.bind(this));
this.editor.actions.each(this.add.bind(this));
}
return this;
},
Expand Down

0 comments on commit c3f72ec

Please sign in to comment.