Skip to content

Commit

Permalink
Merge pull request #429 from hwshim/master
Browse files Browse the repository at this point in the history
[BUGFIX] Global menu for workspace and editors
  • Loading branch information
hwshim committed Sep 11, 2015
2 parents 23d8e6d + b2d0ad3 commit 1940b9a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1480,10 +1480,10 @@ define([
deferred.resolve(items);
});
} else {
deferred.resolve(items);
deferred.resolve(items);
}
} else {
deferred.resolve(items);
deferred.resolve(items);
}
},

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1477,7 +1477,7 @@ define([
}
},

getMenuItemsUnderEdit: function(items, menuItems) {
getMenuItemsUnderEdit: function(items, menuItems, deferred) {
var editor = this.editor;

if (editor) {
Expand Down Expand Up @@ -1528,7 +1528,7 @@ define([
items['&Source'] = sourceItems;
}

return items;
deferred.resolve(items);
},

/**
Expand Down
9 changes: 6 additions & 3 deletions common/src/webida/plugins/editors/viable-menu-items.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,17 @@ define([
function getItemsUnderEdit() {
logger.info('getItemsUnderEdit()');
var items = {};
var deferred = new Deferred();
var part = _getCurrentEditorPart();
if (part) {
var viewer = part.getViewer();
if (viewer) {
items = viewer.getMenuItemsUnderEdit(items, menuItems);
items = viewer.getMenuItemsUnderEdit(items, menuItems, deferred);
}
} else {
deferred.resolve(items);
}
return items;
return deferred;
}

function getItemsUnderFind() {
Expand Down Expand Up @@ -123,7 +126,6 @@ define([
var naviEditorsItems = {};
var itemsList = ['&Select Tab from List', '&Previous Tab', '&Next Tab', 'Move Tab to &Other Container', '&Ex-Selected Tab', 'Switch &Tab Container'];


function getViewRunnableMenuItems(menuName) {
var splitContainer = editors.splitViewContainer;
var focusedVc = splitContainer.getFocusedViewContainer();
Expand Down Expand Up @@ -167,6 +169,7 @@ define([
return false;
}


_.each(itemsList, function(item) {
if (getViewRunnableMenuItems(item)) {
naviEditorsItems[item] = menuItems.navMenuItems['&Navigate Editors'][item];
Expand Down

0 comments on commit 1940b9a

Please sign in to comment.