Reverted changes after refactor

This commit is contained in:
Henry
2015-11-27 13:05:55 -08:00
parent 4b23e3fbcb
commit 6558461fda
2 changed files with 1 additions and 19 deletions

View File

@@ -55,14 +55,12 @@ define(
$rootScope, $rootScope,
popupService, popupService,
agentService, agentService,
navigationService,
actionContext actionContext
) { ) {
this.$compile = $compile; this.$compile = $compile;
this.agentService = agentService; this.agentService = agentService;
this.actionContext = actionContext; this.actionContext = actionContext;
this.popupService = popupService; this.popupService = popupService;
this.navigationService = navigationService;
this.getDocument = function () { return $document; }; this.getDocument = function () { return $document; };
this.getRootScope = function () { return $rootScope; }; this.getRootScope = function () { return $rootScope; };
} }
@@ -82,7 +80,7 @@ define(
initiatingEvent = this.agentService.isMobile() ? initiatingEvent = this.agentService.isMobile() ?
'touchstart' : 'mousedown', 'touchstart' : 'mousedown',
menu, menu,
popup popup;
// Remove the context menu // Remove the context menu
function dismiss() { function dismiss() {

View File

@@ -47,8 +47,6 @@ define(
mockScope, mockScope,
mockElement, mockElement,
mockDomainObject, mockDomainObject,
mockNavigatedObject,
mockNavigationService,
mockEvent, mockEvent,
mockPopup, mockPopup,
mockActionContext, mockActionContext,
@@ -69,11 +67,9 @@ define(
]); ]);
mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]); mockRootScope = jasmine.createSpyObj("$rootScope", ["$new"]);
mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]); mockAgentService = jasmine.createSpyObj("agentService", ["isMobile"]);
mockNavigationService = jasmine.createSpyObj("navigationService", ["getNavigation"]);
mockScope = jasmine.createSpyObj("scope", ["$destroy"]); mockScope = jasmine.createSpyObj("scope", ["$destroy"]);
mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS); mockElement = jasmine.createSpyObj("element", JQLITE_FUNCTIONS);
mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS); mockDomainObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
mockNavigatedObject = jasmine.createSpyObj("domainObject", DOMAIN_OBJECT_METHODS);
mockEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation"]); mockEvent = jasmine.createSpyObj("event", ["preventDefault", "stopPropagation"]);
mockEvent.pageX = 123; mockEvent.pageX = 123;
mockEvent.pageY = 321; mockEvent.pageY = 321;
@@ -83,7 +79,6 @@ define(
mockDocument.find.andReturn(mockBody); mockDocument.find.andReturn(mockBody);
mockRootScope.$new.andReturn(mockScope); mockRootScope.$new.andReturn(mockScope);
mockPopupService.display.andReturn(mockPopup); mockPopupService.display.andReturn(mockPopup);
mockNavigationService.getNavigation.andReturn(mockNavigatedObject);
mockActionContext = {key: 'menu', domainObject: mockDomainObject, event: mockEvent}; mockActionContext = {key: 'menu', domainObject: mockDomainObject, event: mockEvent};
@@ -93,7 +88,6 @@ define(
mockRootScope, mockRootScope,
mockPopupService, mockPopupService,
mockAgentService, mockAgentService,
mockNavigationService,
mockActionContext mockActionContext
); );
}); });
@@ -188,15 +182,6 @@ define(
expect(mockBody.off).not.toHaveBeenCalled(); expect(mockBody.off).not.toHaveBeenCalled();
}); });
it("is not active when in edit mode", function () {
mockNavigatedObject.hasCapability.andReturn(true);
// Show the menu
action.perform();
expect(mockPopupService.display).not.toHaveBeenCalled();
});
it("keeps a menu when menu is clicked on mobile", function () { it("keeps a menu when menu is clicked on mobile", function () {
mockAgentService.isMobile.andReturn(true); mockAgentService.isMobile.andReturn(true);
action = new ContextMenuAction( action = new ContextMenuAction(
@@ -205,7 +190,6 @@ define(
mockRootScope, mockRootScope,
mockPopupService, mockPopupService,
mockAgentService, mockAgentService,
mockNavigationService,
mockActionContext mockActionContext
); );
action.perform(); action.perform();