[Mobile] Update agentService usages

This commit is contained in:
Victor Woeltjen
2015-09-18 10:07:27 -07:00
parent 0b4f44f00d
commit fa186a1556
6 changed files with 40 additions and 48 deletions

View File

@@ -31,17 +31,20 @@ define(
"use strict";
function MobileBrowseTreeController($scope, navigationService, agentService) {
var object = navigationService.getNavigation();
var object = navigationService.getNavigation(),
self = this;
// Collapse tree when navigation changes
function changeObject(newObject) {
if (newObject !== object) {
if (newObject !== object && agentService.isPortrait()) {
object = newObject;
this.state = false;
self.state = false;
}
}
navigationService.listen(changeObject);
if (agentService.isMobile()) {
navigationService.listen(changeObject);
}
this.state = true;
}