mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 00:16:15 -04:00
fix
This commit is contained in:
parent
bb868beb9c
commit
467fc11b72
1 changed files with 12 additions and 7 deletions
|
@ -68,7 +68,7 @@ ButtonsGroup.prototype.addButton = function (button) {
|
||||||
};
|
};
|
||||||
|
|
||||||
ButtonsGroup.prototype.render = function () {
|
ButtonsGroup.prototype.render = function () {
|
||||||
if (this.buttons.length == 1) {
|
if (this.buttons && this.buttons.length == 1) {
|
||||||
this.buttons[0].grouping = "";
|
this.buttons[0].grouping = "";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -80,7 +80,7 @@ ButtonsGroup.prototype.render = function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
return _.map(this.buttons, function (btn) {
|
return _.map(this.buttons, function (btn) {
|
||||||
return btn.render();
|
if(btn) return btn.render();
|
||||||
}).join("\n");
|
}).join("\n");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -90,11 +90,16 @@ Button = function (attributes) {
|
||||||
|
|
||||||
Button.load = function (btnName) {
|
Button.load = function (btnName) {
|
||||||
var button = module.exports.availableButtons[btnName];
|
var button = module.exports.availableButtons[btnName];
|
||||||
if (button.constructor === Button || button.constructor === SelectButton) {
|
try{
|
||||||
return button;
|
if (button.constructor === Button || button.constructor === SelectButton) {
|
||||||
}
|
return button;
|
||||||
else {
|
}
|
||||||
return new Button(button);
|
else {
|
||||||
|
return new Button(button);
|
||||||
|
}
|
||||||
|
}catch(e){
|
||||||
|
console.warn("Error loading button", btnName);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue