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

Commit

Permalink
Code cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeaun committed Mar 19, 2009
1 parent 126f04b commit 6e8fbe9
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions Source/MooEditable/MooEditable.Group.js
Expand Up @@ -17,7 +17,6 @@ MooEditable.Group = new Class({
initialize: function(toolbarEl, options){
this.setOptions(options);
this.actions = this.options.actions.clean().split(' ');
// setup toolbar
var self = this;
this.toolbar = new MooEditable.UI.Toolbar({
onItemAction: function(){
Expand All @@ -33,9 +32,7 @@ MooEditable.Group = new Class({
},

add: function(el, options){
var editor = new MooEditable.Group.Item(el, this, $merge({toolbar:false}, options));
this.activeEditor = editor;
return editor;
return this.activeEditor = new MooEditable.Group.Item(el, this, $merge({toolbar: false}, options));
}

});
Expand All @@ -48,14 +45,11 @@ MooEditable.Group.Item = new Class({
initialize: function(el, group, options){
this.group = group;
this.parent(el, options);
// add focus events
this.textarea.addEvent('focus', function(){
var focus = function(){
this.group.activeEditor = this;
}.bind(this));
// safari doesnt fire onfocus event, so make it onclick
this.win.addEvent('focus', function(){
this.group.activeEditor = this;
}.bind(this));
}.bind(this);
this.textarea.addEvent('focus', focus);
this.win.addEvent('focus', focus);
}

});

0 comments on commit 6e8fbe9

Please sign in to comment.