Skip to content

Commit

Permalink
Merge pull request adobe#1294 from adobe/pflynn/issue-1292
Browse files Browse the repository at this point in the history
Fix issue adobe#1292 (Lots of menu-related console spam)
  • Loading branch information
joelrbrandt committed Jul 23, 2012
2 parents a90d7c2 + 6f04669 commit fb9a0da
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/command/Menus.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,8 @@ define(function (require, exports, module) {

// Determine the $relativeElement by traversing the sibling list and
// stop at the first divider found
// TODO: simplify using nextUntil()/prevUntil()
var $sectionMarker = this._getMenuItemForCommand(CommandManager.get(relativeID.sectionMarker));
var $sectionItems = $sectionMarker.siblings();
var $listElem = $sectionMarker;
$relativeElement = $listElem;
while (true) {
Expand All @@ -343,7 +343,12 @@ define(function (require, exports, module) {
$relativeElement = $listElem;
}
}

} else {
if (relativeID.hasOwnProperty("sectionMarker")) {
console.log("Bad Parameter in _getRelativeMenuItem(): if relativeID is a MenuSection, position must be FIRST_IN_SECTION or LAST_IN_SECTION");
}

// handle FIRST, LAST, BEFORE, & AFTER
var command = CommandManager.get(relativeID);
if (command) {
Expand All @@ -354,8 +359,9 @@ define(function (require, exports, module) {
}

return $relativeElement;
} else {
console.log("Bad Parameter in _getRelativeMenuItem(): relativeID not specified");

} else if (position && position !== FIRST && position !== LAST) {
console.log("Bad Parameter in _getRelativeMenuItem(): relative position specified with no relativeID");
}

return $relativeElement;
Expand Down Expand Up @@ -910,7 +916,7 @@ define(function (require, exports, module) {
inline_editor_cmenu.addMenuDivider();
inline_editor_cmenu.addMenuItem(Commands.QUICK_EDIT_PREV_MATCH);
inline_editor_cmenu.addMenuItem(Commands.QUICK_EDIT_NEXT_MATCH);

/**
* Context menu for code editors (both full-size and inline)
* Auto selects the word the user clicks if the click does not occur over
Expand Down

0 comments on commit fb9a0da

Please sign in to comment.