Fix syntax

This commit is contained in:
Zhuo Lu 2018-01-01 02:23:32 +08:00
parent d45914c3f7
commit b8ec84c761

View file

@ -11,8 +11,9 @@ const MenuItem = function (options) {
for (let key in options) { for (let key in options) {
if (!(key in this)) this[key] = options[key] if (!(key in this)) this[key] = options[key]
} }
if (typeof this.role === 'string' || this.role instanceof String) if (typeof this.role === 'string' || this.role instanceof String) {
this.role = this.role.toLowerCase() this.role = this.role.toLowerCase()
}
this.submenu = this.submenu || roles.getDefaultSubmenu(this.role) this.submenu = this.submenu || roles.getDefaultSubmenu(this.role)
if (this.submenu != null && this.submenu.constructor !== Menu) { if (this.submenu != null && this.submenu.constructor !== Menu) {
this.submenu = Menu.buildFromTemplate(this.submenu) this.submenu = Menu.buildFromTemplate(this.submenu)