Skip to content

Commit

Permalink
Merge pull request #233 from owncloud/small-fixes
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
Henni committed Mar 19, 2016
2 parents aef99a7 + 5fd1026 commit 46c397e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions js/components/contactList/contactList_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ app.controller('contactlistCtrl', function($scope, $filter, $route, $routeParams
ContactService.getAll().then(function(contacts) {
$scope.$apply(function() {
ctrl.contacts = contacts;
if (!_.isEmpty(ctrl.contacts)) {
ctrl.setSelectedId(_.sortBy(contacts, function(contact) {
return contact.fullName();
})[0].uid());
}
ctrl.loading = false;
});
});
Expand Down Expand Up @@ -105,6 +110,11 @@ app.controller('contactlistCtrl', function($scope, $filter, $route, $routeParams
gid: $routeParams.gid,
uid: ctrl.contactList[0].uid()
});
} else {
$route.updateParams({
gid: $routeParams.gid,
uid: undefined
});
}
unbindWatch(); // unbind as we only want one update
});
Expand Down
2 changes: 1 addition & 1 deletion templates/contactList.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
ng-click="setSelected(contact.uid())"
ng-class="{active: contact.uid() === ctrl.getSelectedId()}">
</div>
<div ng-show="!ctrl.contactList.length && !ctrl.loading">
<div ng-show="!ctrl.contactList.length && !ctrl.loading && ctrl.searchTerm !== ''">
<div id="emptysearch" class="">
<div class="icon-search"></div>
<h2>{{ctrl.t.emptySearch}}</h2>
Expand Down

0 comments on commit 46c397e

Please sign in to comment.