Fix call & add remove avatar preview removal

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2016-12-11 17:19:32 +01:00
parent 90fd40a263
commit a7abddec09
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
1 changed files with 14 additions and 11 deletions

View File

@ -7,6 +7,7 @@ angular.module('contactsApp')
ctrl.removePhoto = function() {
ctrl.contact.removeProperty('photo', ctrl.contact.getProperty('photo'));
ContactService.update(ctrl.contact);
$('avatar').removeClass('maximized');
};
ctrl.downloadPhoto = function() {
@ -40,17 +41,19 @@ angular.module('contactsApp')
ctrl.openPhoto = function() {
$('avatar').toggleClass('maximized');
$('avatar').click(function() {
$('avatar').removeClass('maximized');
});
$('avatar img, avatar .avatar-options').click(function(e) {
e.stopPropagation();
});
$(document).keyup(function(e) {
if (e.keyCode === 27) {
$('avatar').removeClass('maximized');
}
});
};
// Quit avatar preview
$('avatar').click(function() {
$('avatar').removeClass('maximized');
});
$('avatar img, avatar .avatar-options').click(function(e) {
e.stopPropagation();
});
$(document).keyup(function(e) {
if (e.keyCode === 27) {
$('avatar').removeClass('maximized');
}
});
});