[Mobile] Merge
Fix Conflicts.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
{
|
||||
"key": "menu",
|
||||
"implementation": "gestures/ContextMenuGesture.js",
|
||||
"depends": []
|
||||
"depends": ["queryService"]
|
||||
}
|
||||
],
|
||||
"components": [
|
||||
|
||||
@@ -39,16 +39,18 @@ define(
|
||||
* @param {DomainObject} domainObject the object on which actions
|
||||
* in the context menu will be performed
|
||||
*/
|
||||
function ContextMenuGesture(element, domainObject) {
|
||||
function ContextMenuGesture(queryService, element, domainObject) {
|
||||
var actionContext,
|
||||
stop;
|
||||
|
||||
// When context menu event occurs, show object actions instead
|
||||
element.on('contextmenu', function (event) {
|
||||
actionContext = {key: 'menu', domainObject: domainObject, event: event};
|
||||
stop = domainObject.getCapability('action').perform(actionContext);
|
||||
});
|
||||
|
||||
if (!queryService.isMobile(navigator.userAgent)) {
|
||||
element.on('contextmenu', function (event) {
|
||||
actionContext = {key: 'menu', domainObject: domainObject, event: event};
|
||||
stop = domainObject.getCapability('action').perform(actionContext);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Detach any event handlers associated with this gesture.
|
||||
|
||||
@@ -36,6 +36,7 @@ define(
|
||||
|
||||
describe("The 'context menu' gesture", function () {
|
||||
var mockElement,
|
||||
mockQueryService,
|
||||
mockDomainObject,
|
||||
mockEvent,
|
||||
gesture,
|
||||
@@ -45,8 +46,9 @@ define(
|
||||
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
|
||||
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
|
||||
mockEvent = jasmine.createSpyObj("event", ["preventDefault"]);
|
||||
|
||||
gesture = new ContextMenuGesture(mockElement, mockDomainObject);
|
||||
mockQueryService = jasmine.createSpyObj("queryService", ["isMobile"]);
|
||||
|
||||
gesture = new ContextMenuGesture(mockQueryService, mockElement, mockDomainObject);
|
||||
|
||||
// Capture the contextmenu callback
|
||||
fireGesture = mockElement.on.mostRecentCall.args[1];
|
||||
|
||||
Reference in New Issue
Block a user