Amended change so that context menu only suppressed on navigation menu

This commit is contained in:
Henry 2015-11-27 14:16:37 -08:00
parent 6558461fda
commit b573b3a681
3 changed files with 8 additions and 8 deletions

View File

@ -67,8 +67,7 @@
"$document", "$document",
"$rootScope", "$rootScope",
"popupService", "popupService",
"agentService", "agentService"
"navigationService"
] ]
} }
] ]

View File

@ -64,8 +64,7 @@ define(
domainObject.getCapability('action').perform({ domainObject.getCapability('action').perform({
key: 'menu', key: 'menu',
domainObject: domainObject, domainObject: domainObject,
event: event, event: event
element: element
}); });
} }
} }

View File

@ -30,14 +30,16 @@ define(
function (ContextMenuGesture) { function (ContextMenuGesture) {
"use strict"; "use strict";
var JQLITE_FUNCTIONS = [ "on", "off", "find", "append", "remove" ], var JQLITE_FUNCTIONS = [ "on", "off", "find", "append", "remove", "attr" ],
DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability"]; DOMAIN_OBJECT_METHODS = [ "getId", "getModel", "getCapability", "hasCapability", "useCapability"];
describe("The 'context menu' gesture", function () { describe("The 'context menu' gesture", function () {
var mockTimeout, var mockTimeout,
mockParse,
mockElement, mockElement,
mockAgentService, mockAgentService,
mockNavigationService,
mockDomainObject, mockDomainObject,
mockEvent, mockEvent,
mockTouchEvent, mockTouchEvent,
@ -51,6 +53,7 @@ define(
beforeEach(function () { beforeEach(function () {
mockTimeout = jasmine.createSpy("$timeout"); mockTimeout = jasmine.createSpy("$timeout");
mockParse = jasmine.createSpy("$parse");
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS); mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]); mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]);
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS); mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
@ -69,8 +72,7 @@ define(
mockContextMenuAction.perform.andReturn(jasmine.any(Function)); mockContextMenuAction.perform.andReturn(jasmine.any(Function));
mockAgentService.isMobile.andReturn(false); mockAgentService.isMobile.andReturn(false);
gesture = new ContextMenuGesture(mockTimeout, mockParse, mockAgentService, mockNavigationService, mockElement, mockDomainObject);
gesture = new ContextMenuGesture(mockTimeout, mockAgentService, mockElement, mockDomainObject);
// Capture the contextmenu callback // Capture the contextmenu callback
fireGesture = mockElement.on.mostRecentCall.args[1]; fireGesture = mockElement.on.mostRecentCall.args[1];
@ -106,7 +108,7 @@ define(
mockAgentService.isMobile.andReturn(true); mockAgentService.isMobile.andReturn(true);
// Then create new (mobile) gesture // Then create new (mobile) gesture
gesture = new ContextMenuGesture(mockTimeout, mockAgentService, mockElement, mockDomainObject); gesture = new ContextMenuGesture(mockTimeout, mockParse, mockAgentService, mockNavigationService, mockElement, mockDomainObject);
// Set calls for the touchstart and touchend gestures // Set calls for the touchstart and touchend gestures
fireTouchStartGesture = mockElement.on.calls[1].args[1]; fireTouchStartGesture = mockElement.on.calls[1].args[1];