[Mobile] AgentService & Tests

Adjusted the getOrientation of agentService to
inject the window instead of calling for it in
agentService. Also adjusted treeNodeController
for this. Added tests for the agentService's
getOrientation function.
This commit is contained in:
Shivam Dave
2015-08-25 14:33:48 -07:00
parent d80c359a86
commit 9cd57614e4
3 changed files with 11 additions and 15 deletions

View File

@ -182,7 +182,7 @@ define(
// and in portrait mode, than, hide the tree menu
TreeNodeController.prototype.setObject = function (ngModel, domainObject) {
ngModel.selectedObject = domainObject;
if (this.agentService.getOrientation() === "portrait" &&
if (this.agentService.getOrientation(window.innerWidth, window.innerHeight) === "portrait" &&
this.agentService.isPhone(navigator.userAgent)) {
this.$scope.$emit('select-obj');
}