Merge branch 'open1062' into open-master

Merge changes for WTD-1062
This commit is contained in:
Victor Woeltjen
2015-04-08 12:48:49 -07:00
13 changed files with 389 additions and 8 deletions

View File

@@ -84,11 +84,21 @@ define(
// Build up look-up tables
actions.forEach(function (Action) {
if (Action.category) {
actionsByCategory[Action.category] =
actionsByCategory[Action.category] || [];
actionsByCategory[Action.category].push(Action);
}
// Get an action's category or categories
var categories = Action.category || [];
// Convert to an array if necessary
categories = Array.isArray(categories) ?
categories : [categories];
// Store action under all relevant categories
categories.forEach(function (category) {
actionsByCategory[category] =
actionsByCategory[category] || [];
actionsByCategory[category].push(Action);
});
// Store action by ekey as well
if (Action.key) {
actionsByKey[Action.key] =
actionsByKey[Action.key] || [];