mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Fix default user cover on settings pane
Closes #2806 - Ensures that the user's cover property is a string, otherwise uses the default cover.
This commit is contained in:
parent
c6d037b595
commit
cc12fb701c
1 changed files with 7 additions and 3 deletions
|
@ -1,10 +1,14 @@
|
||||||
/*global alert */
|
/*global alert */
|
||||||
|
|
||||||
var SettingsUserController = Ember.Controller.extend({
|
var SettingsUserController = Ember.Controller.extend({
|
||||||
|
coverDefault: '/shared/img/user-cover.png',
|
||||||
cover: function () {
|
cover: function () {
|
||||||
// @TODO: add {{asset}} subdir path
|
// @TODO: add {{asset}} subdir path
|
||||||
return this.user.getWithDefault('cover', '/shared/img/user-cover.png');
|
var cover = this.user.get('cover');
|
||||||
}.property('user.cover'),
|
if (typeof cover !== 'string') {
|
||||||
|
cover = this.get('coverDefault');
|
||||||
|
}
|
||||||
|
return cover;
|
||||||
|
}.property('user.cover', 'coverDefault'),
|
||||||
|
|
||||||
coverTitle: function () {
|
coverTitle: function () {
|
||||||
return this.get('user.name') + '\'s Cover Image';
|
return this.get('user.name') + '\'s Cover Image';
|
||||||
|
|
Loading…
Add table
Reference in a new issue