[Browse] Menu action called correctly

Both the menu gesture and the menu arrow now
correctly call the menu action. #33.
This commit is contained in:
Sarah Hale 2015-07-02 11:57:03 -07:00
parent 809a6e457c
commit c08f972ab4
3 changed files with 8 additions and 7 deletions

View File

@ -25,6 +25,6 @@
<span ng-if="parameters.mode" class='action'>{{parameters.mode}}</span> <span ng-if="parameters.mode" class='action'>{{parameters.mode}}</span>
<span class='type-name'>{{type.getName()}}</span> <span class='type-name'>{{type.getName()}}</span>
<span class='title-label'>{{model.name}}</span> <span class='title-label'>{{model.name}}</span>
<mct-representation key="'menu-arrow'"></mct-representation> <mct-representation key="'menu-arrow'" mct-object='domainObject'></mct-representation>
</span> </span>
</div> </div>

View File

@ -36,7 +36,7 @@ define(
* @constructor * @constructor
*/ */
function MenuArrowController($scope) { function MenuArrowController($scope) {
var domainObject = $scope.domainObject, var //domainObject = $scope.domainObject,
context; context;
function showMenu(event) { function showMenu(event) {
@ -44,18 +44,19 @@ define(
console.log('$scope ', $scope); console.log('$scope ', $scope);
console.log('$scope.domainObject ', $scope.domainObject); console.log('$scope.domainObject ', $scope.domainObject);
console.log('domainObject ', domainObject); //console.log('domainObject ', domainObject);
console.log('event ', event); console.log('event ', event);
context = {key: 'menu', event: event, domainObject: domainObject}; context = {key: 'menu', event: event, domainObject: $scope.domainObject};
domainObject.getCapability('action').perform(context); $scope.domainObject.getCapability('action').perform(context);
} }
/*
// attempt to set the domain object // attempt to set the domain object
$scope.$watch('domainObject', function (c) { $scope.$watch('domainObject', function (c) {
domainObject = c; domainObject = c;
console.log('watcher called'); console.log('watcher called');
}); });
*/
return { return {
showMenu: showMenu showMenu: showMenu

View File

@ -50,7 +50,7 @@ define(
function ContextMenuAction($compile, $document, $window, $rootScope, actionContext) { function ContextMenuAction($compile, $document, $window, $rootScope, actionContext) {
function perform() { function perform() {
//console.log('in perform()'); console.log('in perform()');
var winDim = [$window.innerWidth, $window.innerHeight], var winDim = [$window.innerWidth, $window.innerHeight],
eventCoors = [actionContext.event.pageX, actionContext.event.pageY], eventCoors = [actionContext.event.pageX, actionContext.event.pageY],
menuDim = GestureConstants.MCT_MENU_DIMENSIONS, menuDim = GestureConstants.MCT_MENU_DIMENSIONS,