summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/css/apps.scss4
-rw-r--r--core/img/actions/info.svg2
-rw-r--r--core/js/jquery.avatar.js10
-rw-r--r--core/js/tests/specs/jquery.avatarSpec.js6
4 files changed, 15 insertions, 7 deletions
diff --git a/core/css/apps.scss b/core/css/apps.scss
index f2255aa53bb..8fbe035fc85 100644
--- a/core/css/apps.scss
+++ b/core/css/apps.scss
@@ -234,10 +234,9 @@ kbd {
z-index: 100; /* above the bullet */
/* TODO: forbid using img as icon in menu? */
&:first-child img {
- margin-bottom: -3px;
margin-right: 11px;
width: 16px;
- margin-left: 2px;
+ margin-left: -30px;
}
/* counter can also be inside the link */
@@ -495,6 +494,7 @@ kbd {
z-index 250ms ease-in-out;
position: absolute;
background-color: $color-main-background;
+ box-sizing: border-box;
}
/**
diff --git a/core/img/actions/info.svg b/core/img/actions/info.svg
index f6438ed7035..35926af30de 100644
--- a/core/img/actions/info.svg
+++ b/core/img/actions/info.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1"><path color="#000" fill="none" d="M-62.897-32.993h163.31v97.986h-163.31z"/><path opacity=".5" d="M5 7.474c.155.382.325.69.644.246.407-.268 1.76-1.427 1.662-.342-.368 2.017-.834 4.017-1.17 6.04-.393 1.114.634 2.067 1.637 1.31 1.078-.502 1.99-1.287 2.927-2.01-.144-.323-.25-.79-.596-.347-.468.24-1.47 1.318-1.696.472.315-2.18.975-4.295 1.365-6.462.397-1.005-.364-2.223-1.4-1.363C7.117 5.634 6.083 6.6 5 7.474zM9.46.005C8.15-.017 7.553 2.147 8.815 2.68c1.023.378 2.077-.714 1.79-1.75-.098-.542-.598-.97-1.147-.93z"/></svg> \ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1"><path color="#000" fill="none" d="M-62.897-32.993h163.31v97.986h-163.31z"/><path d="M5 7.474c.155.382.325.69.644.246.407-.268 1.76-1.427 1.662-.342-.368 2.017-.834 4.017-1.17 6.04-.393 1.114.634 2.067 1.637 1.31 1.078-.502 1.99-1.287 2.927-2.01-.144-.323-.25-.79-.596-.347-.468.24-1.47 1.318-1.696.472.315-2.18.975-4.295 1.365-6.462.397-1.005-.364-2.223-1.4-1.363C7.117 5.634 6.083 6.6 5 7.474zM9.46.005C8.15-.017 7.553 2.147 8.815 2.68c1.023.378 2.077-.714 1.79-1.75-.098-.542-.598-.97-1.147-.93z"/></svg> \ No newline at end of file
diff --git a/core/js/jquery.avatar.js b/core/js/jquery.avatar.js
index 29d019baea7..fae100fda21 100644
--- a/core/js/jquery.avatar.js
+++ b/core/js/jquery.avatar.js
@@ -48,6 +48,11 @@
(function ($) {
$.fn.avatar = function(user, size, ie8fix, hidedefault, callback, displayname) {
+ var setAvatarForUnknownUser = function(target) {
+ target.imageplaceholder('?');
+ target.css('background-color', '#b9b9b9');
+ };
+
if (typeof(user) !== 'undefined') {
user = String(user);
}
@@ -72,7 +77,7 @@
if (typeof(this.data('user')) !== 'undefined') {
user = this.data('user');
} else {
- this.imageplaceholder('?');
+ setAvatarForUnknownUser(this);
return;
}
}
@@ -112,8 +117,7 @@
$div.imageplaceholder(user, result.data.displayname);
} else {
// User does not exist
- $div.imageplaceholder(user, '?');
- $div.css('background-color', '#b9b9b9');
+ setAvatarForUnknownUser($div);
}
} else {
$div.hide();
diff --git a/core/js/tests/specs/jquery.avatarSpec.js b/core/js/tests/specs/jquery.avatarSpec.js
index dab78500d0b..d7305736690 100644
--- a/core/js/tests/specs/jquery.avatarSpec.js
+++ b/core/js/tests/specs/jquery.avatarSpec.js
@@ -62,10 +62,12 @@ describe('jquery.avatar tests', function() {
it('undefined user', function() {
spyOn($div, 'imageplaceholder');
+ spyOn($div, 'css');
$div.avatar();
expect($div.imageplaceholder).toHaveBeenCalledWith('?');
+ expect($div.css).toHaveBeenCalledWith('background-color', '#b9b9b9');
});
describe('no avatar', function() {
@@ -86,6 +88,7 @@ describe('jquery.avatar tests', function() {
it('show placeholder for non existing user', function() {
spyOn($div, 'imageplaceholder');
+ spyOn($div, 'css');
$div.avatar('foo');
fakeServer.requests[0].respond(
@@ -96,7 +99,8 @@ describe('jquery.avatar tests', function() {
})
);
- expect($div.imageplaceholder).toHaveBeenCalledWith('foo', '?');
+ expect($div.imageplaceholder).toHaveBeenCalledWith('?');
+ expect($div.css).toHaveBeenCalledWith('background-color', '#b9b9b9');
});
it('show no placeholder', function() {