ignore set menu item fields
This commit is contained in:
parent
e9ba5abe03
commit
344dda4029
1 changed files with 4 additions and 4 deletions
|
@ -269,7 +269,7 @@ Menu.getApplicationMenu = function() {
|
|||
Menu.sendActionToFirstResponder = bindings.sendActionToFirstResponder;
|
||||
|
||||
Menu.buildFromTemplate = function(template) {
|
||||
var insertIndex, item, j, k, key, len, len1, menu, menuItem, positionedTemplate, value;
|
||||
var insertIndex, item, j, k, key, len, len1, menu, menuItem, positionedTemplate;
|
||||
if (!Array.isArray(template)) {
|
||||
throw new TypeError('Invalid template for Menu');
|
||||
}
|
||||
|
@ -293,9 +293,9 @@ Menu.buildFromTemplate = function(template) {
|
|||
}
|
||||
menuItem = new MenuItem(item);
|
||||
for (key in item) {
|
||||
value = item[key];
|
||||
if (menuItem[key] == null) {
|
||||
menuItem[key] = value;
|
||||
// Preserve extra fields specified by user
|
||||
if (!menuItem.hasOwnProperty(key)) {
|
||||
menuItem[key] = item[key];
|
||||
}
|
||||
}
|
||||
menu.append(menuItem);
|
||||
|
|
Loading…
Reference in a new issue