Skip to content

Commit fb9a0da

Browse files
committedJul 23, 2012
Merge pull request adobe#1294 from adobe/pflynn/issue-1292
Fix issue adobe#1292 (Lots of menu-related console spam)
2 parents a90d7c2 + 6f04669 commit fb9a0da

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed
 

‎src/command/Menus.js

+10-4
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ define(function (require, exports, module) {
329329

330330
// Determine the $relativeElement by traversing the sibling list and
331331
// stop at the first divider found
332+
// TODO: simplify using nextUntil()/prevUntil()
332333
var $sectionMarker = this._getMenuItemForCommand(CommandManager.get(relativeID.sectionMarker));
333-
var $sectionItems = $sectionMarker.siblings();
334334
var $listElem = $sectionMarker;
335335
$relativeElement = $listElem;
336336
while (true) {
@@ -343,7 +343,12 @@ define(function (require, exports, module) {
343343
$relativeElement = $listElem;
344344
}
345345
}
346+
346347
} else {
348+
if (relativeID.hasOwnProperty("sectionMarker")) {
349+
console.log("Bad Parameter in _getRelativeMenuItem(): if relativeID is a MenuSection, position must be FIRST_IN_SECTION or LAST_IN_SECTION");
350+
}
351+
347352
// handle FIRST, LAST, BEFORE, & AFTER
348353
var command = CommandManager.get(relativeID);
349354
if (command) {
@@ -354,8 +359,9 @@ define(function (require, exports, module) {
354359
}
355360

356361
return $relativeElement;
357-
} else {
358-
console.log("Bad Parameter in _getRelativeMenuItem(): relativeID not specified");
362+
363+
} else if (position && position !== FIRST && position !== LAST) {
364+
console.log("Bad Parameter in _getRelativeMenuItem(): relative position specified with no relativeID");
359365
}
360366

361367
return $relativeElement;
@@ -910,7 +916,7 @@ define(function (require, exports, module) {
910916
inline_editor_cmenu.addMenuDivider();
911917
inline_editor_cmenu.addMenuItem(Commands.QUICK_EDIT_PREV_MATCH);
912918
inline_editor_cmenu.addMenuItem(Commands.QUICK_EDIT_NEXT_MATCH);
913-
919+
914920
/**
915921
* Context menu for code editors (both full-size and inline)
916922
* Auto selects the word the user clicks if the click does not occur over

0 commit comments

Comments
 (0)
Please sign in to comment.