mirror of https://github.com/nextcloud/contacts
Highlight selected group
This commit is contained in:
parent
2e832f7d7d
commit
361754e26b
|
@ -6,4 +6,8 @@ app.controller('grouplistCtrl', ['$scope', 'ContactService', function($scope, Co
|
|||
$scope.groups = groups;
|
||||
});
|
||||
|
||||
$scope.selectedGroup = null;
|
||||
$scope.setSelected = function (selectedGroup) {
|
||||
$scope.selectedGroup = selectedGroup;
|
||||
};
|
||||
}]);
|
||||
|
|
|
@ -129,6 +129,24 @@ app.directive('contactdetails', function() {
|
|||
};
|
||||
});
|
||||
|
||||
app.controller('groupCtrl', function() {
|
||||
var ctrl = this;
|
||||
console.log(this);
|
||||
});
|
||||
|
||||
app.directive('group', function() {
|
||||
return {
|
||||
restrict: 'A', // has to be an attribute to work with core css
|
||||
scope: {},
|
||||
controller: 'groupCtrl',
|
||||
controllerAs: 'ctrl',
|
||||
bindToController: {
|
||||
addressBook: "=data"
|
||||
},
|
||||
templateUrl: OC.linkTo('contactsrework', 'templates/group.html')
|
||||
};
|
||||
});
|
||||
|
||||
app.controller('contactlistCtrl', ['$scope', 'ContactService', '$routeParams', function($scope, ContactService, $routeParams) {
|
||||
var ctrl = this;
|
||||
|
||||
|
@ -163,24 +181,6 @@ app.directive('contactlist', function() {
|
|||
templateUrl: OC.linkTo('contactsrework', 'templates/contactList.html')
|
||||
};
|
||||
});
|
||||
app.controller('groupCtrl', function() {
|
||||
var ctrl = this;
|
||||
console.log(this);
|
||||
});
|
||||
|
||||
app.directive('group', function() {
|
||||
return {
|
||||
restrict: 'A', // has to be an attribute to work with core css
|
||||
scope: {},
|
||||
controller: 'groupCtrl',
|
||||
controllerAs: 'ctrl',
|
||||
bindToController: {
|
||||
addressBook: "=data"
|
||||
},
|
||||
templateUrl: OC.linkTo('contactsrework', 'templates/group.html')
|
||||
};
|
||||
});
|
||||
|
||||
app.controller('grouplistCtrl', ['$scope', 'ContactService', function($scope, ContactService) {
|
||||
|
||||
$scope.groups = [];
|
||||
|
@ -189,6 +189,10 @@ app.controller('grouplistCtrl', ['$scope', 'ContactService', function($scope, Co
|
|||
$scope.groups = groups;
|
||||
});
|
||||
|
||||
$scope.selectedGroup = null;
|
||||
$scope.setSelected = function (selectedGroup) {
|
||||
$scope.selectedGroup = selectedGroup;
|
||||
};
|
||||
}]);
|
||||
|
||||
app.directive('grouplist', function() {
|
||||
|
|
|
@ -1 +1 @@
|
|||
<li ng-repeat="group in groups" group data="group"></li>
|
||||
<li ng-repeat="group in groups" group data="group" ng-click="setSelected(group)" ng-class="{active: group === selectedGroup}"></li>
|
||||
|
|
Loading…
Reference in New Issue