Skip to content

Commit

Permalink
The toolbar can now span on multiple rows using the '/' separator
Browse files Browse the repository at this point in the history
  • Loading branch information
Olivier Laviale committed Aug 14, 2011
1 parent 241d285 commit 84a0fc6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Source/MooEditable/MooEditable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1067,7 +1067,13 @@ MooEditable.UI.Toolbar= new Class({
this.el.adopt(this.content);
} else {
this.content = actions.map(function(action){
return (action == '|') ? this.addSeparator() : this.addItem(action);
if (action == '|') {
return this.addSeparator();
}
else if (action == '/') {
return this.addLineSeparator();
}
return this.addItem(action);
}.bind(this));
}
return this;
Expand Down Expand Up @@ -1095,9 +1101,13 @@ MooEditable.UI.Toolbar= new Class({
},

addSeparator: function(){
return new Element('span', {'class': 'toolbar-separator'}).inject(this.el);
return new Element('span.toolbar-separator').inject(this.el);
},


addLineSeparator: function(){
return new Element('div.toolbar-line-separator').inject(this.el);
},

itemAction: function(){
this.fireEvent('itemAction', arguments);
},
Expand Down

0 comments on commit 84a0fc6

Please sign in to comment.