[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 class='type-name'>{{type.getName()}}</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>
</div>

View File

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

View File

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