Files
openmct/platform/commonUI/general/src/ContextMenuController.js
Victor Woeltjen 80430234d6 [Common UI] Add JSDoc
Add JSDoc to remaining scripts in bundle
platform/commonUI/general. WTD-574.
2014-11-24 16:39:52 -08:00

31 lines
848 B
JavaScript

/*global define,Promise*/
/**
* Module defining ContextMenuController. Created by vwoeltje on 11/17/14.
*/
define(
[],
function () {
"use strict";
/**
* Controller for the context menu. Maintains an up-to-date
* list of applicable actions (those from category "contextual")
*
* @constructor
*/
function ContextMenuController($scope) {
// Refresh variable "menuActions" in the scope
function updateActions() {
$scope.menuActions = $scope.action ?
$scope.action.getActions({ category: 'contextual' }) :
[];
}
// Update using the action capability
$scope.$watch("action", updateActions);
}
return ContextMenuController;
}
);