fix click on contact list

This commit is contained in:
Hendrik Leppelsack 2016-02-18 15:47:57 +01:00 committed by Thomas Müller
parent 8896d3b8e4
commit e0b24d2519
3 changed files with 26 additions and 18 deletions

View File

@ -1,6 +1,10 @@
app.controller('contactCtrl', [function() {
app.controller('contactCtrl', ['$route', function($route) {
var ctrl = this;
ctrl.openContact = function() {
$route.updateParams({uid: ctrl.contact.uid()});
};
console.log("Contact: ",ctrl.contact);
}]);

View File

@ -22,6 +22,22 @@ app.config(['$routeProvider', function($routeProvider){
}]);
app.controller('addressbookCtrl', function() {
var ctrl = this;
console.log(this);
});
app.directive('addressbook', function() {
return {
restrict: 'A', // has to be an attribute to work with core css
scope: {},
controller: 'addressbookCtrl',
controllerAs: 'ctrl',
bindToController: {
addressBook: "=data"
},
templateUrl: OC.linkTo('contactsrework', 'templates/addressBook.html')
};
});
app.controller('addressbooklistCtrl', ['$scope', 'AddressBookService', 'SettingsService', function(scope, AddressBookService, SettingsService) {
var ctrl = this;
@ -49,24 +65,12 @@ app.directive('addressbooklist', function() {
};
});
app.controller('addressbookCtrl', function() {
app.controller('contactCtrl', ['$route', function($route) {
var ctrl = this;
console.log(this);
});
app.directive('addressbook', function() {
return {
restrict: 'A', // has to be an attribute to work with core css
scope: {},
controller: 'addressbookCtrl',
controllerAs: 'ctrl',
bindToController: {
addressBook: "=data"
},
templateUrl: OC.linkTo('contactsrework', 'templates/addressBook.html')
ctrl.openContact = function() {
$route.updateParams({uid: ctrl.contact.uid()});
};
});
app.controller('contactCtrl', [function() {
var ctrl = this;
console.log("Contact: ",ctrl.contact);

View File

@ -1,4 +1,4 @@
<a class="app-content-list-item-link" ng-href="#/{{ctrl.contact.uid()}}">
<a class="app-content-list-item-link" ng-click="ctrl.openContact()">
<div class="app-content-list-item-icon contact__icon" ng-style="{'background-color': (ctrl.contact.uid() | contactColor) }">{{ ctrl.contact.fullName() | firstCharacter }}</div>
<div class="app-content-list-item-star icon-star" data-starred="false"></div>